stanley-king hace 2 años
padre
commit
8223371f5a

+ 14 - 3
helper/refill/RefillBase.php

@@ -59,13 +59,20 @@ class RefillBase
         }
         elseif ($caller->verify($input))
         {
-            [$order_id, $success, $can_try, $need_handle] = $caller->notify($input);
+            $values = $caller->notify($input);
+            if(count($values) == 4) {
+                [$order_id, $success, $can_try, $need_handle] = $values;
+                $official_sn = false;
+            } else {
+                [$order_id, $success, $can_try, $need_handle, $official_sn] = $values;
+            }
+
             if (!$need_handle) {
                 return true;
             }
 
             if ($order_id !== false) {
-                return $this->proc_notify($order_id, $success, $can_try, $chname,$input);
+                return $this->proc_notify($order_id, $success, $can_try, $chname, $input, $official_sn);
             } else {
                 Log::record("{$chname} callback 系统无此订单ID:{$order_id}", Log::ERR);
             }
@@ -116,7 +123,7 @@ class RefillBase
         return $spcheker();
     }
 
-    private function proc_notify($order_id, $success, $can_try, $chname, $input = [])
+    private function proc_notify($order_id, $success, $can_try, $chname, $input = [], $official_sn = false)
     {
         $mod_order = Model('vr_order');
         $order_info = $mod_order->partition(util::part_notify())->getOrderInfo(['order_id' => $order_id]);
@@ -163,6 +170,10 @@ class RefillBase
             $mch_order = $refill_info['mch_order'];
             $order_time = intval($refill_info['order_time']);
 
+            if($official_sn != false and count($official_sn) > 48) {
+
+            }
+
             if($success && $this->risksn_check($refill_info)) {
                 $tran->commit();
                 $params = ['store_id' => $order_info['store_id'],

+ 6 - 4
helper/refill/api/xyz/meixu/RefillCallBack.php

@@ -29,20 +29,22 @@ class RefillCallBack implements refill\IRefillCallBack
     {
         $status = intval($params['resultno']);
         $order_sn = $params['sporderid'];
+
         $order_info = Model('vr_order')->getOrderInfoForNotify(['order_sn' => $order_sn]);
         if (empty($order_info)) {
-            return [false, false, false, false];
+            return [false, false, false, false, ''];
         }
 
         $order_id = $order_info['order_id'];
         if ($status === 1) {
             $data['official_sn'] = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            $official_sn = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
             Model('refill_order')->edit($order_id, $data);
-            return [$order_id, true, false, true];
+            return [$order_id, true, false, true, $official_sn];
         } elseif ($status === 9) {
-            return [$order_id, false, true, true];
+            return [$order_id, false, true, true, ''];
         } else {
-            return [$order_id, false, false, false];
+            return [$order_id, false, false, false, ''];
         }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 8 - 0
test/TestHttp.php