Kirin преди 2 години
родител
ревизия
36781107d1
променени са 3 файла, в които са добавени 22 реда и са изтрити 1 реда
  1. 1 1
      app/api/controller/PublicController.php
  2. 7 0
      crmeb/services/MiniProgramService.php
  3. 14 0
      vendor/overtrue/wechat/src/Payment/API.php

+ 1 - 1
app/api/controller/PublicController.php

@@ -45,7 +45,7 @@ class PublicController
         var_dump(count($order));
         try {
             foreach ($order as $v) {
-                $res = MiniProgramService::profit_sharing_finish($v['transaction_id'], $v['order_id']);
+                $res = MiniProgramService::profit_sharing_query($v['transaction_id'], $v['order_id']);
                 var_dump($res);
 //                exit;
             }

+ 7 - 0
crmeb/services/MiniProgramService.php

@@ -384,4 +384,11 @@ class MiniProgramService
     {
         return self::paymentService()->profitSharingFinish($orderNo, $sharingNo);
     }
+    /**
+     * 完结分账
+     */
+    public static function profit_sharing_query($orderNo, $sharingNo)
+    {
+        return self::paymentService()->profitSharingQuery($orderNo, $sharingNo);
+    }
 }

+ 14 - 0
vendor/overtrue/wechat/src/Payment/API.php

@@ -78,6 +78,7 @@ class API extends AbstractAPI
     const API_MULTI_PROFIT_SHARING = '/secapi/pay/multiprofitsharing';
     const API_PROFIT_SHARING_ADD_RECEIVER = '/secapi/pay/profitsharingaddreceiver';
     const API_PROFIT_SHARING_FINISH = '/secapi/pay/profitsharingfinish';
+    const API_PROFIT_SHARING_QUERY = '/pay/profitsharingquery';
 
     const API_URL_SHORTEN = 'https://api.mch.weixin.qq.com/tools/shorturl';
     const API_AUTH_CODE_TO_OPENID = 'https://api.mch.weixin.qq.com/tools/authcodetoopenid';
@@ -627,4 +628,17 @@ class API extends AbstractAPI
         ];
         return $this->safeRequest($this->wrapApi(self::API_PROFIT_SHARING_FINISH), $params, 'post', 'hash_hmac');
     }
+
+    public function profitSharingQuery(
+        $orderNo,
+        $sharingNo,
+        $type = self::TRANSACTION_ID
+    )
+    {
+        $params = [
+            $type => $orderNo,
+            'out_order_no' => $sharingNo,
+        ];
+        return $this->safeRequest($this->wrapApi(self::API_PROFIT_SHARING_QUERY), $params, 'post', 'hash_hmac');
+    }
 }