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

支付宝

... ... @@ -170,15 +170,15 @@ class IndexController extends HomeBaseController
'total_amount' => 0.01,
];
$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);
// $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();
$return = $alipay->wapPay($params, '', '');
print_r($return);
}
... ...
<?php
$config = array (
//应用ID,您的APPID。
'app_id' => "",
'app_id' => "2018101661696470",
//商户私钥,您的原始格式RSA私钥
'merchant_private_key' => "",
'merchant_private_key' => config('private_key'),
//异步通知地址
'notify_url' => "http://工程公网访问地址/alipay.trade.wap.pay-PHP-UTF-8/notify_url.php",
... ... @@ -22,7 +22,7 @@ $config = array (
'gatewayUrl' => "https://openapi.alipay.com/gateway.do",
//支付宝公钥,查看地址:https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
'alipay_public_key' => "",
'alipay_public_key' => config('alipay_public_key'),
);
\ No newline at end of file
... ...