|
|
@@ -38,6 +38,7 @@ class PaymentController extends Controller
|
|
|
{
|
|
|
$goods_id = intval($request->get('goods_id'));
|
|
|
$coupon_sn = $request->get('coupon_sn');
|
|
|
+ $pay_type = $request->get('pay_type');
|
|
|
|
|
|
$goods = Goods::query()->where('is_del', 0)->where('status', 1)->where('id', $goods_id)->first();
|
|
|
if (!$goods) {
|
|
|
@@ -146,7 +147,12 @@ class PaymentController extends Controller
|
|
|
}
|
|
|
}else if(self::$systemConfig['is_trimepay']){
|
|
|
$trimepay = new Trimepay(self::$systemConfig['trimepay_appid'], self::$systemConfig['trimepay_appsecret']);
|
|
|
- $result = $trimepay->pay('WEPAY_QR', $orderSn, $amount, self::$systemConfig['website_url'].'/api/trimepay', self::$systemConfig['website_url']);
|
|
|
+ if($pay_type==1){
|
|
|
+ $payMethod='ALIPAY_QR';
|
|
|
+ }else if($pay_type==2){
|
|
|
+ $payMethod='WEPAY_QR';
|
|
|
+ }
|
|
|
+ $result = $trimepay->pay($payMethod, $orderSn, $amount, self::$systemConfig['website_url'].'/api/trimepay', self::$systemConfig['website_url']);
|
|
|
if ($result['code']!==0) {
|
|
|
Log::error('【Trimepay】创建二维码失败:' . $result['msg']);
|
|
|
|
|
|
@@ -185,7 +191,9 @@ class PaymentController extends Controller
|
|
|
}
|
|
|
|
|
|
DB::commit();
|
|
|
-
|
|
|
+ if(self::$systemConfig['is_trimepay']){
|
|
|
+
|
|
|
+ }
|
|
|
return Response::json(['status' => 'success', 'data' => $sn, 'message' => '创建订单成功,正在转到付款页面,请稍后']);
|
|
|
} catch (\Exception $e) {
|
|
|
DB::rollBack();
|