yansongda/hyperf-pay

可能是基于 hyperf 的最优雅的支付宝、微信支付 SDK 了

v1.0.1 2021-11-29 12:44 UTC

This package is auto-updated.

Last update: 2022-01-08 07:39:41 UTC


README

Logo

运行环境

  • php >= 7.3
  • composer
  • hyperf >= 2.1

安装

composer require yansongda/hyperf-pay:~1.0.0 -W

说明

发布配置文件

php bin/hyperf.php vendor:publish yansongda/hyperf-pay

使用

<?php

declare(strict_types=1);

namespace App\Controller;

use Yansongda\HyperfPay\Pay;
use Hyperf\HttpServer\Annotation\AutoController;

/**
 * @AutoController()
 */
class IndexController extends AbstractController
{
    public function index(Pay $pay)
    {
        return $pay->alipay()->web([
            'out_trade_no' => ''.time(),
            'total_amount' => '0.01',
            'subject' => 'yansongda 测试 - 1',
        ]);
    }
}

详细文档

https://pay.yansongda.cn