yansongda / hyperf-pay
可能是基于 hyperf 的最优雅的支付宝、微信、银联支付 SDK 了
Installs: 39 336
Dependents: 2
Suggesters: 0
Security: 0
Stars: 75
Watchers: 3
Forks: 10
Open Issues: 0
Requires
- php: >=8.0
- hyperf/guzzle: ^3.0
- yansongda/pay: ~3.7.0
Requires (Dev)
- composer/composer: ^2.0
- friendsofphp/php-cs-fixer: ^3.0
- hyperf/event: ^3.0
- hyperf/logger: ^3.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^10.0
- swoole/ide-helper: dev-master
- symfony/var-dumper: ^5.1
Suggests
- swow/swow: Required to create swow components.
This package is auto-updated.
Last update: 2024-10-27 15:12:06 UTC
README
运行环境
- php >= 8.0
- composer
- hyperf >= 3.0
安装
composer require yansongda/hyperf-pay:~1.7.0
说明
发布配置文件
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', ]); } }