|
|
@@ -232,6 +232,9 @@ class StoreOrderController
|
|
|
$isChannel = 0;
|
|
|
elseif ($from == 'weixinh5')
|
|
|
$isChannel = 2;
|
|
|
+ elseif ($from == 'app') {
|
|
|
+ $isChannel = 3;
|
|
|
+ }
|
|
|
$order = StoreOrder::cacheKeyCreateOrder($request->uid(), $key, $addressId, $payType, (int)$useIntegral,
|
|
|
$couponId, $mark, $combinationId, $pinkId, $seckill_id, $bargainId, false, $isChannel,
|
|
|
$shipping_type, $real_name, $phone, $storeId);
|
|
|
@@ -263,6 +266,8 @@ class StoreOrderController
|
|
|
$jsConfig = OrderRepository::jsPay($orderId); //创建订单jspay
|
|
|
} else if ($from == 'weixinh5') {
|
|
|
$jsConfig = OrderRepository::h5Pay($orderId);
|
|
|
+ } else if ($from == 'app') {
|
|
|
+ $jsConfig = OrderRepository::wxAppPay($orderId);
|
|
|
} else {
|
|
|
$jsConfig = OrderRepository::wxPay($orderId);
|
|
|
}
|
|
|
@@ -270,11 +275,14 @@ class StoreOrderController
|
|
|
return app('json')->status('pay_error', $e->getMessage(), $info);
|
|
|
}
|
|
|
$info['jsConfig'] = $jsConfig;
|
|
|
- if ($from == 'weixinh5') {
|
|
|
- return app('json')->status('wechat_h5_pay', '订单创建成功', $info);
|
|
|
- } else {
|
|
|
- return app('json')->status('wechat_pay', '订单创建成功', $info);
|
|
|
- }
|
|
|
+ return app('json')->status($payType . '_' . $from, '订单创建成功', $info);
|
|
|
+ // if ($from == 'weixinh5') {
|
|
|
+ // return app('json')->status('wechat_h5_pay', '订单创建成功', $info);
|
|
|
+ // } elseif ($from == 'app') {
|
|
|
+ // return app('json')->status('wechat_app_pay', '订单创建成功', $info);
|
|
|
+ // } else {
|
|
|
+ // return app('json')->status('wechat_pay', '订单创建成功', $info);
|
|
|
+ // }
|
|
|
}
|
|
|
break;
|
|
|
case 'yue':
|
|
|
@@ -416,6 +424,9 @@ class StoreOrderController
|
|
|
$isChannel = 0;
|
|
|
elseif ($from == 'weixinh5')
|
|
|
$isChannel = 2;
|
|
|
+ elseif ($from == 'app') {
|
|
|
+ $isChannel = 3;
|
|
|
+ }
|
|
|
$porderId = StoreOrderBatch::cacheKeyCreateOrderBatch($request->uid(), $key, $addressId, $payType, (int)$useIntegral,
|
|
|
$couponId, $mark, $combinationId, $pinkId, $seckill_id, $bargainId, false, $isChannel,
|
|
|
$shipping_type, $real_name, $phone, $storeId);
|
|
|
@@ -449,6 +460,8 @@ class StoreOrderController
|
|
|
$jsConfig = OrderRepository::jsPayBatch($porderId); //创建订单jspay
|
|
|
} else if ($from == 'weixinh5') {
|
|
|
$jsConfig = OrderRepository::h5PayBatch($porderId);
|
|
|
+ } elseif ($from == 'app') {
|
|
|
+ $jsConfig = OrderRepository::wxAppPayBatch($porderId);
|
|
|
} else {
|
|
|
$jsConfig = OrderRepository::wxPayBatch($porderId);
|
|
|
}
|
|
|
@@ -456,11 +469,12 @@ class StoreOrderController
|
|
|
return app('json')->status('pay_error', $e->getMessage(), $info);
|
|
|
}
|
|
|
$info['jsConfig'] = $jsConfig;
|
|
|
- if ($from == 'weixinh5') {
|
|
|
- return app('json')->status('wechat_h5_pay', '订单创建成功', $info);
|
|
|
- } else {
|
|
|
- return app('json')->status('wechat_pay', '订单创建成功', $info);
|
|
|
- }
|
|
|
+ return app('json')->status($payType . '_' . $from, '订单创建成功', $info);
|
|
|
+ // if ($from == 'weixinh5') {
|
|
|
+ // return app('json')->status('wechat_h5_pay', '订单创建成功', $info);
|
|
|
+ // } else {
|
|
|
+ // return app('json')->status('wechat_pay', '订单创建成功', $info);
|
|
|
+ // }
|
|
|
}
|
|
|
break;
|
|
|
case 'yue':
|
|
|
@@ -539,17 +553,22 @@ class StoreOrderController
|
|
|
}
|
|
|
}
|
|
|
if ($from == 'weixin') {//0
|
|
|
- if (in_array($order->is_channel, [1, 2]))
|
|
|
+ if (in_array($order->is_channel, [1, 2, 3]))
|
|
|
$order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id'];
|
|
|
}
|
|
|
if ($from == 'weixinh5') {//2
|
|
|
- if (in_array($order->is_channel, [0, 1]))
|
|
|
+ if (in_array($order->is_channel, [0, 1, 3]))
|
|
|
$order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id'];
|
|
|
}
|
|
|
if ($from == 'routine') {//1
|
|
|
- if (in_array($order->is_channel, [0, 2]))
|
|
|
+ if (in_array($order->is_channel, [0, 2, 3]))
|
|
|
$order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id'];
|
|
|
}
|
|
|
+ if ($from == 'app') {
|
|
|
+ if (in_array($order->is_channel, [0, 1, 2])) {
|
|
|
+ $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id'];
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
$order['pay_type'] = $paytype; //重新支付选择支付方式
|
|
|
switch ($order['pay_type']) {
|
|
|
@@ -559,17 +578,22 @@ class StoreOrderController
|
|
|
$jsConfig = OrderRepository::jsPay($order); //订单列表发起支付
|
|
|
} else if ($from == 'weixinh5') {
|
|
|
$jsConfig = OrderRepository::h5Pay($order);
|
|
|
+ } else if ($from == 'app') {
|
|
|
+ $jsConfig = OrderRepository::wxAppPay($order);
|
|
|
} else {
|
|
|
$jsConfig = OrderRepository::wxPay($order);
|
|
|
}
|
|
|
} catch (\Exception $e) {
|
|
|
return app('json')->fail($e->getMessage());
|
|
|
}
|
|
|
- if ($from == 'weixinh5') {
|
|
|
- return app('json')->status('wechat_h5_pay', ['jsConfig' => $jsConfig, 'order_id' => $order['order_id']]);
|
|
|
- } else {
|
|
|
- return app('json')->status('wechat_pay', ['jsConfig' => $jsConfig, 'order_id' => $order['order_id']]);
|
|
|
- }
|
|
|
+
|
|
|
+ return app('json')->status($paytype . '_' . $from, ['jsConfig' => $jsConfig, 'order_id' => $order['order_id']]);
|
|
|
+
|
|
|
+ // if ($from == 'weixinh5') {
|
|
|
+ // return app('json')->status('wechat_h5_pay', ['jsConfig' => $jsConfig, 'order_id' => $order['order_id']]);
|
|
|
+ // } else {
|
|
|
+ // return app('json')->status('wechat_pay', ['jsConfig' => $jsConfig, 'order_id' => $order['order_id']]);
|
|
|
+ // }
|
|
|
break;
|
|
|
case 'yue':
|
|
|
if (StoreOrder::yuePay($order['order_id'], $request->uid()))
|
|
|
@@ -586,6 +610,8 @@ class StoreOrderController
|
|
|
else
|
|
|
return app('json')->status('success', '支付失败');
|
|
|
break;
|
|
|
+ case 'alipay':
|
|
|
+ break;
|
|
|
}
|
|
|
return app('json')->fail('支付方式错误');
|
|
|
}
|