forgetphp / hyperf-pay
可能是基于 hyperf 的最优雅的支付宝、微信、银联支付 SDK 了
dev-main
2023-03-08 12:48 UTC
Requires
- php: >=7.4
- hyperf/guzzle: ^2.1|^3.0
- yansongda/pay: ^2.10
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- hyperf/event: ^2.1
- hyperf/logger: ^2.1
- mockery/mockery: ^1.0
- phpstan/phpstan: ^0.12
- phpunit/phpunit: >=7.0
- swoole/ide-helper: dev-master
- swow/swow: dev-develop
- symfony/var-dumper: ^5.1
This package is auto-updated.
Last update: 2025-01-08 17:00:26 UTC
README
运行环境
- php >= 7.4
- composer
- hyperf >= 2.1
安装
composer require forgetphp/hyperf-pay:~1.2.0
说明
发布配置文件
php bin/hyperf.php vendor:publish forgetphp/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', ]); } }