haru haru преди 3 години
родител
ревизия
c4c1f2f231

+ 1 - 1
helper/refill/api/xyz/shantong/RefillCallBack.php

@@ -23,7 +23,7 @@ class RefillCallBack implements refill\IRefillCallBack
         $order_sn = $params['orderId'];
         $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
         if (empty($order_info)) {
-//            return [false, false, false,false];
+            return [false, false, false,false];
         }
 
         $order_id = $order_info['order_id'];

+ 1 - 5
helper/refill/api/xyz/shantong/RefillPhone.php

@@ -80,7 +80,7 @@ class RefillPhone extends refill\IRefillPhone
             {
                 $status = $resp['data']['orderStatus'];
                 if ($status === 3) {
-                    $updata['official_sn'] = $resp['ispVoucherId'];
+                    $updata['official_sn'] = $resp['data']['ispVoucherId'];
                     Model('refill_order')->edit($refill_info['order_id'], $updata);
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($status === 99) {
@@ -92,10 +92,6 @@ class RefillPhone extends refill\IRefillPhone
                 }
                 return [true, $order_state];
             }
-            elseif ($resp['code'] === '3002' && (time() - $refill_info['commit_time'] >= 600))
-            {
-                return [true, ORDER_STATE_NOEXIST];
-            }
             else
             {
                 return [false, $resp['msg']];

+ 1 - 2
helper/refill/api/xyz/shantong/config.php

@@ -11,8 +11,7 @@ class config
     const transactionPin = 'Qwer@1234';
     const APP_ID = 'cz_1004';
     const APP_KEY = '3c7795c7-beb3-45fc-b764-98c270062c90';
-//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_shantong.php";
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_shantong.php";
     const ExtHeaders = ['Content-Type: application/json;charset=UTF-8'];
 
     private static function createNoncestr( $length = 32 )

+ 7 - 0
mobile/callback/refill_shantong.php

@@ -0,0 +1,7 @@
+<?php
+
+$content = $_SERVER['post_content'];
+$input = json_decode($content,true) ?? [];
+refill\util::push_notify('shantong',$input);
+
+echo ('SUCCESS');

+ 1 - 1
test/TestRefill.php

@@ -2164,7 +2164,7 @@ class TestRefill extends TestCase
 //        $resp = $provider->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
 //        $resp = $provider->query(['order_sn' => '35151650783370889788']);
 
-        $body = '{"orderId":"35151650783370889788","mobile":"18500608333","sign":"5a9295de0cab6b85c182a968a53b7f19","orderStatus":99,"businessOrderId":"10040424100000001","finishDate":"2022-04-24 14:56:24","perValue":100}';
+        $body = '{"orderId":"23691650852278427609","mobile":"18500608333","sign":"e7239f5bc48819fcb18942ae56beba6c","orderStatus":3,"businessOrderId":"10040425100000001","finishDate":"2022-04-25 10:24:17","perValue":100}';
         $params = json_decode($body, true);
         $provider = $this->getProvider('shantong','RefillCallBack');
         $ret = $provider->verify($params);