作者 lihan
1 个管道 的构建 通过 耗费 0 秒

支付宝

... ... @@ -165,20 +165,21 @@ class IndexController extends HomeBaseController
{
require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php';
$params = [
'subject' => '购买',
'out_trade_no' => '20181017256210',
'total_amount' => 0.01,
'WIDsubject' => '购买',
'WIDout_trade_no' => '20181017256210',
'WIDtotal_amount' => 0.01,
'WIDbody' => '商品'
];
// $alipay_config = [
// 'gatewayUrl' => 'https://openapi.alipay.com/gateway.do',
// 'app_id' => '2018101661696470',
// 'merchant_private_key' => config('private_key'),
// 'alipay_public_key' => config('alipay_public_key'),
// 'charset' => 'UTF-8',
// 'sign_type' => 'RSA'
// ];
$alipay = new \AlipayTradeService();
$alipay_config = [
'gatewayUrl' => 'https://openapi.alipay.com/gateway.do',
'app_id' => '2018101661696470',
'merchant_private_key' => config('private_key'),
'alipay_public_key' => config('alipay_public_key'),
'charset' => 'UTF-8',
'sign_type' => 'RSA'
];
$alipay = new \AlipayTradeService($alipay_config);
$return = $alipay->wapPay($params, '', '');
print_r($return);
}
... ...