stanley-king 1 年之前
父节点
当前提交
0d5844c3df
共有 2 个文件被更改,包括 4 次插入10 次删除
  1. 3 1
      helper/refill/api/xyz/leyou/RefillCallBack.php
  2. 1 9
      helper/refill/api/xyz/leyou/RefillOil.php

+ 3 - 1
helper/refill/api/xyz/leyou/RefillCallBack.php

@@ -19,7 +19,7 @@ class RefillCallBack implements refill\IRefillCallBack
     private function sign($params)
     {
         $key = config::APP_KEY;
-        $content = "{$params['username']}{$params['orderNumber']}{$params['number']}{$params['money']}[{$params['status']}]{$params['endTime']}{$key}";
+        $content = "{$params['username']}{$params['orderNumber']}{$params['number']}{$params['money']}[{$params['status']}]{$params['endTime']}$key";
         return md5($content);
     }
 
@@ -34,6 +34,8 @@ class RefillCallBack implements refill\IRefillCallBack
         $order_id = $order_info['order_id'];
 
         if ($status === 5) {
+            $official_sn = config::extract_official_sn($params['voucher']);
+            Model('refill_order')->edit($order_id, ['official_sn' => $official_sn]);
             return [$order_id, true, false, true, ''];
         }
         elseif ($status === 6) {

+ 1 - 9
helper/refill/api/xyz/leyou/RefillOil.php

@@ -69,15 +69,6 @@ class RefillOil extends refill\IRefillOil
 
     public function query($refill_info)
     {
-        $waterno_by_voucher = function($voucher):string {
-            $matches = [];
-            $ret = preg_match("/\:(\d+)/",$voucher,$matches);
-            if ($ret === 1 && !empty($matches)){
-                return $matches[1];
-            }
-          return '';
-        };
-        
         $params['username'] = config::USER_NAME;
         $params['orderNumber'] = $refill_info['order_sn'];
         $params['sign'] = $this->sign($params);
@@ -158,6 +149,7 @@ class RefillOil extends refill\IRefillOil
             }
         }
         $originalStr .= config::APP_KEY;
+
         return md5($originalStr);
     }
 }