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

This package is auto-updated.

Last update: 2020-11-09 13:38:48 UTC


README

Build Status StyleCI Latest Stable Version License

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);

License

MIT