trrtly / wechat
easywechat for hyperf
Installs: 2 047
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: >=7.4
- ext-json: *
- hyperf/config: ~3.1.0
- hyperf/framework: ~3.1.0
- hyperf/guzzle: ~3.1.0
- overtrue/wechat: ^5.7
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- hyperf/testing: ~3.1.0
- mockery/mockery: ^1.0
- phpstan/phpstan: ^0.12
- phpunit/phpunit: >=7.0
- swoole/ide-helper: ^4.5
- swow/swow: dev-develop
- symfony/var-dumper: ^5.1
README
针对 hyperf 的 easywechat 组件.
安装
composer require trrtly/wechat
示例
use Trrtly\Wechat\Wechat; use Hyperf\Di\Annotation\Inject; use Hyperf\Contract\ConfigInterface; class Example { public function transferToBalance(ConfigInterface $config) { $app = Wechat::payment($config->get('wechat.payment')); $response = $app->transfer->toBalance([ 'partner_trade_no' => '1233455', // 商户订单号,需保持唯一性(只能是字母或者数字,不能包含有符号) 'openid' => 'oxTWIuGaIt6gTKsQRLau2M0yL16E', 'check_name' => 'FORCE_CHECK', // NO_CHECK:不校验真实姓名, FORCE_CHECK:强校验真实姓名 're_user_name' => '王小帅', // 如果 check_name 设置为FORCE_CHECK,则必填用户真实姓名 'amount' => 10000, // 企业付款金额,单位为分 'desc' => '理赔', // 企业付款操作说明信息。必填 ]); var_dump($response); } }