...
|
...
|
@@ -358,6 +358,44 @@ class OrderController extends HomeBaseController |
|
|
|
|
|
public function alipay()
|
|
|
{
|
|
|
if(!cmf_is_wechat()) {
|
|
|
header("Content-type: text/html; charset=utf-8");
|
|
|
require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php';
|
|
|
require_once EXTEND_PATH . '/alipay/wappay/buildermodel/AlipayTradeWapPayContentBuilder.php';
|
|
|
require EXTEND_PATH . '/alipay/config.php';
|
|
|
if (1 == 1) {
|
|
|
//商户订单号,商户网站订单系统中唯一订单号,必填
|
|
|
$out_trade_no = '20181017210243564' . rand(10000, 99999);
|
|
|
|
|
|
//订单名称,必填
|
|
|
$subject = '购买';
|
|
|
|
|
|
//付款金额,必填
|
|
|
$total_amount = 0.01;
|
|
|
|
|
|
//商品描述,可空
|
|
|
$body = '商品';
|
|
|
|
|
|
//超时时间
|
|
|
$timeout_express = "1m";
|
|
|
|
|
|
$payRequestBuilder = new \AlipayTradeWapPayContentBuilder();
|
|
|
$payRequestBuilder->setBody($body);
|
|
|
$payRequestBuilder->setSubject($subject);
|
|
|
$payRequestBuilder->setOutTradeNo($out_trade_no);
|
|
|
$payRequestBuilder->setTotalAmount($total_amount);
|
|
|
$payRequestBuilder->setTimeExpress($timeout_express);
|
|
|
|
|
|
$payResponse = new \AlipayTradeService($config);
|
|
|
$result = $payResponse->wapPay($payRequestBuilder, $config['return_url'], $config['notify_url']);
|
|
|
return;
|
|
|
}
|
|
|
}else {
|
|
|
return $this->fetch('alipay');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public function alipayDo() {
|
|
|
header("Content-type: text/html; charset=utf-8");
|
|
|
require_once EXTEND_PATH . '/alipay/wappay/service/AlipayTradeService.php';
|
|
|
require_once EXTEND_PATH . '/alipay/wappay/buildermodel/AlipayTradeWapPayContentBuilder.php';
|
...
|
...
|
@@ -387,12 +425,8 @@ class OrderController extends HomeBaseController |
|
|
|
|
|
$payResponse = new \AlipayTradeService($config);
|
|
|
$result = $payResponse->wapPay($payRequestBuilder, $config['return_url'], $config['notify_url']);
|
|
|
return ;
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public function alipayDo() {
|
|
|
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|