Przeglądaj źródła

修复:微信支付退款时报错store_id

Yahoo 4 lat temu
rodzic
commit
888ab31c06

+ 5 - 3
app/api/controller/Notify.php

@@ -8,7 +8,7 @@
 // +----------------------------------------------------------------------
 // | Author: 萤火科技 <admin@yiovo.com>
 // +----------------------------------------------------------------------
-declare (strict_types = 1);
+declare (strict_types=1);
 
 namespace app\api\controller;
 
@@ -24,12 +24,14 @@ class Notify
 {
     /**
      * 支付成功异步通知(微信小程序-微信支付)
-     * @throws BaseException
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
      */
     public function wxpay()
     {
         // 微信支付组件:验证异步通知
         $WxPay = new WxPay();
-        return $WxPay->notify();
+        $WxPay->notify();
     }
 }

+ 7 - 7
app/common/service/order/Refund.php

@@ -30,10 +30,10 @@ class Refund extends BaseService
 {
     /**
      * 执行订单退款
-     * @param mixed $order 订单信息
-     * @param null $money 指定退款金额
+     * @param $order
+     * @param null $money
      * @return bool
-     * @throws BaseException
+     * @throws \cores\exception\BaseException
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
@@ -74,17 +74,17 @@ class Refund extends BaseService
     /**
      * 微信支付退款
      * @param $order
-     * @param $money
+     * @param string $money
      * @return bool
-     * @throws BaseException
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
+     * @throws \cores\exception\BaseException
      */
-    private function wxpay($order, $money): bool
+    private function wxpay($order, string $money): bool
     {
         $wxConfig = WxappSettingModel::getWxappConfig($order['store_id']);
-        $WxPay = new WxPay($wxConfig);
+        $WxPay = new WxPay($wxConfig, $order['store_id']);
         return $WxPay->refund($order['transaction_id'], $order['pay_price'], $money);
     }
 }