...
|
...
|
@@ -168,7 +168,7 @@ class OrderController extends HomeBaseController |
|
|
$this->success('微信支付', url('user/Center/orderDetail', ['oid' => $oid]), $this->wxPay($info));
|
|
|
} //支付宝支付
|
|
|
elseif ($data['payment'] == 2) {
|
|
|
echo json_encode(['msg'=>'支付宝', 'url'=>url('order/Order/temp',['oid'=>$oid,'step'=>1]), 'code'=>20000]);
|
|
|
echo json_encode(['msg' => '支付宝', 'url' => url('order/Order/temp', ['oid' => $oid, 'step' => 1]), 'code' => 20000]);
|
|
|
exit();
|
|
|
} //余额支付
|
|
|
elseif ($data['payment'] == 0) {
|
...
|
...
|
@@ -354,17 +354,18 @@ class OrderController extends HomeBaseController |
|
|
{
|
|
|
$pay = new \Payment();
|
|
|
$return = $pay->handleNotify();
|
|
|
if(!empty($return)) {
|
|
|
if (!empty($return)) {
|
|
|
$order = new OrderModel;
|
|
|
$order->orderCallBack($return['attach'], $return['total_fee']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//微信支付宝中转页面
|
|
|
public function temp() {
|
|
|
if(cmf_is_wechat()) {
|
|
|
public function temp()
|
|
|
{
|
|
|
if (cmf_is_wechat()) {
|
|
|
return $this->fetch(':temp');
|
|
|
}else {
|
|
|
} else {
|
|
|
$request = request();
|
|
|
$oid = $request->param('oid');
|
|
|
$step = $request->param('step');
|
...
|
...
|
@@ -380,9 +381,9 @@ class OrderController extends HomeBaseController |
|
|
->join('activity a', 'o.activity_id=a.id')
|
|
|
->join('activity_schedule s ', 'o.schedule_id=s.id')
|
|
|
->where(['o.id' => $oid])->find();
|
|
|
if($step == 1) {
|
|
|
$total_amount = Db::name('order_info')->where(['id'=>$oid])->value('order_amount');
|
|
|
}elseif ($step == 2) {
|
|
|
if ($step == 1) {
|
|
|
$total_amount = Db::name('order_info')->where(['id' => $oid])->value('order_amount');
|
|
|
} elseif ($step == 2) {
|
|
|
$num = Db::name('order_detail')->where(['oid' => $oid, 'status' => ['neq', 2]])->count();
|
|
|
if ($info['status'] == 1) {
|
|
|
if ($info['order_type'] == 0) {
|
...
|
...
|
@@ -398,17 +399,17 @@ class OrderController extends HomeBaseController |
|
|
$order_amount = 0;
|
|
|
}
|
|
|
$total_amount = $order_amount;
|
|
|
}else {
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
if(!cmf_is_wechat()) {
|
|
|
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';
|
|
|
$out_trade_no = $info['order_sn'].$step;
|
|
|
$subject = '支付宝支付';
|
|
|
$body = $info['name'].'('.date('Y-m-d', $info['start_time']).')';
|
|
|
$out_trade_no = $info['order_sn'] . $step;
|
|
|
$subject = $info['name'] . '(' . date('Y-m-d', $info['start_time']) . ')';
|
|
|
$body = $info['name'] . '(' . date('Y-m-d', $info['start_time']) . ')';
|
|
|
//超时时间
|
|
|
$timeout_express = "1m";
|
|
|
|
...
|
...
|
@@ -421,13 +422,14 @@ class OrderController extends HomeBaseController |
|
|
|
|
|
$payResponse = new \AlipayTradeService($config);
|
|
|
$payResponse->wapPay($payRequestBuilder, $config['return_url'], $config['notify_url']);
|
|
|
}else {
|
|
|
} else {
|
|
|
$this->redirect(url('order/Order/alipayDo'));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//支付宝回调
|
|
|
public function alipayNotify() {
|
|
|
public function alipayNotify()
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
...
|
...
|
|