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

支付宝

... ... @@ -164,12 +164,12 @@ class IndexController extends HomeBaseController
public function alipay()
{
require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php';
$builder = [
'WIDsubject' => '购买',
'WIDout_trade_no' => '20181017256210',
'WIDtotal_amount' => 0.01,
'WIDbody' => '商品'
];
// $builder = [
// 'WIDsubject' => '购买',
// 'WIDout_trade_no' => '20181017256210',
// 'WIDtotal_amount' => 0.01,
// 'WIDbody' => '商品'
// ];
$alipay_config = [
'gatewayUrl' => 'https://openapi.alipay.com/gateway.do',
... ... @@ -179,6 +179,16 @@ class IndexController extends HomeBaseController
'charset' => 'UTF-8',
'sign_type' => 'RSA'
];
$builder ="{" .
" \"body\":\"对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。\"," .
" \"subject\":\"大乐透\"," .
" \"out_trade_no\":\"70501111111S001111119\"," .
" \"timeout_express\":\"90m\"," .
" \"total_amount\":9.00," .
" \"product_code\":\"QUICK_WAP_WAY\"" .
" }";
$alipay = new \AlipayTradeService($alipay_config);
$return = $alipay->wapPay($builder, '', '');
print_r($return);
... ...