guanguans / dcloud-app-pay
This package is abandoned and no longer maintained.
No replacement package was suggested.
DCloud App 支付 SDK
v1.2.2
2019-11-09 10:41 UTC
Requires
- php: >=5.6.0
- ext-json: *
Requires (Dev)
- php: >=5.6.0
- mockery/mockery: ~1.0
- phpunit/phpunit: ~5 || ~7
README
DCloud App 支付,基于 H5P.Server/payment 修改。
安装
$ composer require guanguans/dcloud-app-pay
使用
require_once 'path/vendor/autoload.php'; use Guanguans\Alipay\Alipay; $config = [ 'app_id' => '', // 支付宝提供的 APP_ID 'notify_url' => '', // 支付宝异步通知地址 'ali_public_key' => '', // 支付宝公钥,1行填写 'private_key' => '', // 自己的私钥,1行填写 ]; $alipy = new Alipay($config); $config_biz = [ 'out_trade_no' => time(), // 订单号 'total_amount' => '1', // 订单金额,单位:元 'subject' => 'subject', // 订单商品标题 'body' => 'body', // 订单商品内容 ]; echo $alipy->pay($config_biz);