[更新]修改支付宝参数

This commit is contained in:
Anyon 2018-10-30 17:57:58 +08:00
parent 9dba6a72a6
commit 1505a043ba
6 changed files with 10 additions and 2 deletions

View File

@ -21,12 +21,12 @@ $config = include "./alipay.php";
try {
// 实例支付对象
$pay = new \AliPay\Pos($config);
// 参数链接https://docs.open.alipay.com/api_1/alipay.trade.pay
$result = $pay->apply([
'out_trade_no' => '4312412343', // 订单号
'total_amount' => '13', // 订单金额,单位:元
'subject' => '订单商品标题', // 订单商品标题
'auth_code' => '123456', // 授权码
'notify_url' => 'http://localhost/notify.php', // 定义通知URL
]);
echo '<pre>';
var_export($result);

View File

@ -24,7 +24,9 @@ $out_trade_no = '56737188841424';
$refund_fee = '1.00';
try {
// 实例支付对象
$pay = new \AliPay\App($config);
// 参考链接https://docs.open.alipay.com/api_1/alipay.trade.refund
$result = $pay->refund($out_trade_no, $refund_fee);
echo '<pre>';
var_export($result);

View File

@ -21,6 +21,7 @@ $config = include "./alipay.php";
try {
// 实例支付对象
$pay = new \AliPay\Scan($config);
// 参考链接https://docs.open.alipay.com/api_1/alipay.trade.precreate
$result = $pay->apply([
'out_trade_no' => '14321412', // 订单号
'total_amount' => '13', // 订单金额,单位:元

View File

@ -19,7 +19,9 @@ include "../include.php";
$config = include "./alipay.php";
try {
// 实例支付对象
$pay = new \AliPay\Scan($config);
// 参考链接https://docs.open.alipay.com/api_28/alipay.fund.trans.toaccount.transfer
$result = $pay->apply([
'out_biz_no' => '', // 订单号
'payee_type' => 'ALIPAY_LOGONID', // 收款方账户类型(ALIPAY_LOGONID | ALIPAY_USERID)

View File

@ -22,8 +22,9 @@ $config['notify_url'] = 'http://pay.thinkadmin.top/test/alipay-notify.php';
$config['return_url'] = 'http://pay.thinkadmin.top/test/alipay-success.php';
try {
// 实例支付对象
// 实例支付对象
$pay = new \AliPay\Wap($config);
// 参考链接https://docs.open.alipay.com/api_1/alipay.trade.wap.pay
$result = $pay->apply([
'out_trade_no' => time(), // 商户订单号
'total_amount' => '1', // 支付金额

View File

@ -23,7 +23,9 @@ $config['notify_url'] = 'http://pay.thinkadmin.top/test/alipay-notify.php';
$config['return_url'] = 'http://pay.thinkadmin.top/test/alipay-success.php';
try {
// 实例支付对象
$pay = new \AliPay\Web($config);
// 参考链接https://docs.open.alipay.com/api_1/alipay.trade.page.pay
$result = $pay->apply([
'out_trade_no' => time(), // 商户订单号
'total_amount' => '1', // 支付金额