소스 검색

商城改用epay支付

lizhen_gitee 3 달 전
부모
커밋
0dc99554c9
1개의 변경된 파일20개의 추가작업 그리고 0개의 파일을 삭제
  1. 20 0
      addons/shopro/controller/Pay.php

+ 20 - 0
addons/shopro/controller/Pay.php

@@ -13,6 +13,7 @@ use think\Log;
 use think\Db;
 use addons\shopro\service\pay\PayRefund;
 use Yansongda\Pay\Pay as YansongdaPay;
+use addons\epay\library\Service;
 
 class Pay extends Common
 {
@@ -152,6 +153,25 @@ class Pay extends Common
             $order_data['subject'] = '商城订单支付';
         }
 
+        //下单
+        $params = [
+            'type'         => $payment,
+            'orderid'      => $payModel->pay_sn,
+            'title'        => '商城订单支付',
+            'amount'       => $payModel->pay_fee,
+            'method'       => strtolower($platform),
+//            'openid'       => $openid,
+            'notifyurl' => config('pay_notify_url').'/api/notify/recharge_notify_base/paytype/'.$payment,
+            'returnurl' => '',
+        ];
+        $res = Service::submitOrder($params);
+
+        if($payment == 'wechat'){
+            $this->success('success',json_decode($res,true));
+        }else{
+            $this->success('success',$res);
+        }
+        //原带支付
         $payService = new PayService($payment,$platform);
 
         try {