fly 5 年之前
父节点
当前提交
0de4c40b34
共有 2 个文件被更改,包括 4 次插入5 次删除
  1. 3 4
      app/Http/Controllers/Wap/Pay/OrdersController.php
  2. 1 1
      app/Libs/Pay/Merchants/UnionPay.php

+ 3 - 4
app/Http/Controllers/Wap/Pay/OrdersController.php

@@ -617,7 +617,7 @@ class OrdersController extends Controller
         if ($pay_merchant->config_info) {
             $config = json_decode($pay_merchant->config_info, true);
         }
-        $wechatPay = WechatPay::Union($pay_merchant->source,$config);
+        $wechatPay = WechatPay::Union($pay_merchant->source, $config);
         if (!$wechatPay) return response()->error('WAP_PARAM_ERROR');
         $trade_no = $wechatPay->generateTradeNo();
 
@@ -952,8 +952,7 @@ class OrdersController extends Controller
     public function waitPageUnion(Request $request)
     {
         $order = $request->input('merOrderId');
-        if($order)
-        {
+        if ($order) {
             $from = 'pay';
             $order = (string) $order;
             $order_info = OrderService::getByTradeNo($order);
@@ -985,7 +984,7 @@ class OrdersController extends Controller
 
         $pay_merchant = DB::table('pay_merchants')->select('appid', 'source', 'config_info')->where('id', $pay_merchant_id)->where('is_enabled', 1)->first();
 
-        $application = WechatPay::Official(json_decode($pay_merchant->config_info, true));
+        $application = WechatPay::Official($pay_merchant->source, json_decode($pay_merchant->config_info, true));
         //$app = new Application($options);
         $app = $application->app;
         $response = $app->payment->handleNotify(function ($notify, $successful) {

+ 1 - 1
app/Libs/Pay/Merchants/UnionPay.php

@@ -66,7 +66,7 @@ class UnionPay implements PayMerchantInterface
         return $this->make_order_url . '?' . $query_params;
     }
 
-    public function query($trade_no)
+    public function query(string $trade_no)
     {
         $query_params = [
             'msgType' => 'query',