Browse Source

guantu guantufs update productId

xiaoyu 3 years ago
parent
commit
062b16af7f

+ 4 - 4
helper/refill/api/xyz/guantu/config.php

@@ -15,10 +15,10 @@ class config
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_guantu.php";
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_guantu.php";
     const PRODUCT = [
     const PRODUCT = [
         mtopcard\ChinaMobileCard => [
         mtopcard\ChinaMobileCard => [
-            30  => 100001,
-            50  => 100002,
-            100 => 100003,
-            200 => 100004,
+            30  => 100069,
+            50  => 100070,
+            100 => 100071,
+            200 => 100072,
         ],
         ],
         mtopcard\ChinaUnicomCard => [
         mtopcard\ChinaUnicomCard => [
             30  => 100009,
             30  => 100009,

+ 4 - 4
helper/refill/api/xyz/guantu/商品编码.txt

@@ -1,7 +1,7 @@
-100001 全国移动30
-100002 全国移动50
-100003 全国移动100
-100004 全国移动200
+100069 全国移动30
+100070 全国移动50
+100071 全国移动100
+100072 全国移动200
 
 
 100009 全国联通30
 100009 全国联通30
 100010 全国联通50
 100010 全国联通50

+ 3 - 7
helper/refill/api/xyz/guantufs/RefillPhone.php

@@ -14,12 +14,12 @@ class RefillPhone extends refill\IRefillPhone
         parent::__construct($cfgs);
         parent::__construct($cfgs);
     }
     }
 
 
-    private function req_params(int $phone, int $amount, string $order_sn, $regin_no)
+    private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
     {
     {
         $params['appId'] = config::APP_ID;
         $params['appId'] = config::APP_ID;
         $params['outOrderId'] = $order_sn;
         $params['outOrderId'] = $order_sn;
         $params['uuid'] = $phone;
         $params['uuid'] = $phone;
-        $params['itemId'] = config::PRODUCT[$regin_no][$amount];
+        $params['itemId'] = config::PRODUCT[$card_type][$amount];
         $params['itemFace'] = $amount;
         $params['itemFace'] = $amount;
         $params['callbackUrl'] = config::NOTIFY_URL;
         $params['callbackUrl'] = config::NOTIFY_URL;
         $params['timestamp'] = date("YmdHis").$this->get_millisecond();
         $params['timestamp'] = date("YmdHis").$this->get_millisecond();
@@ -29,11 +29,7 @@ class RefillPhone extends refill\IRefillPhone
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
     {
     {
         $order_sn = $params['order_sn'];
         $order_sn = $params['order_sn'];
-        $regin_no = $params['regin_no'] ?? -1;
-        if($regin_no <= 0) {
-            return [false, '省份获取错误', false];
-        }
-        $params = $this->req_params($card_no, $amount, $order_sn, $regin_no);
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
         if(empty($params['itemId'])) {
         if(empty($params['itemId'])) {
             return [false, '商品编号错误', false];
             return [false, '商品编号错误', false];
         }
         }

+ 7 - 66
helper/refill/api/xyz/guantufs/config.php

@@ -3,6 +3,7 @@
 
 
 namespace refill\guantufs;
 namespace refill\guantufs;
 
 
+use mtopcard;
 class config
 class config
 {
 {
     const ORDER_URL = 'http://8.142.121.158:8911/api/hf/order/submit';
     const ORDER_URL = 'http://8.142.121.158:8911/api/hf/order/submit';
@@ -13,72 +14,12 @@ class config
     const APP_SECRET = 'QjJeQUacifyTfKAy';
     const APP_SECRET = 'QjJeQUacifyTfKAy';
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_guantufs.php";
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_guantufs.php";
     const PRODUCT = [
     const PRODUCT = [
-        23 => [
-            30  => 100025,
-            50  => 100026,
-            100 => 100027,
-            200 => 100028,
-        ],//四川
-        13 => [
-            30  => 100029,
-            50  => 100030,
-            100 => 100031,
-            200 => 100032,
-        ],//福建
-        25 => [
-            30  => 100033,
-            50  => 100034,
-            100 => 100035,
-            200 => 100036,
-        ],//云南
-        11 => [
-            30  => 100037,
-            50  => 100038,
-            100 => 100039,
-            200 => 100040,
-        ],//浙江
-        4 => [
-            30   => 100049,
-            50   => 100050,
-            100  => 100051,
-            200  => 100052,
-        ],//山西
-        27 => [
-            30   => 100045,
-            50   => 100046,
-            100  => 100047,
-            200  => 100048,
-        ],//陕西
-        10 => [
-            30   => 100041,
-            50   => 100042,
-            100  => 100043,
-            200  => 100044,
-        ],//江苏
-        17 => [
-            30   => 100053,
-            50   => 100054,
-            100  => 100055,
-            200  => 100056,
-        ],//湖北
-        15 => [
-            30   => 100057,
-            50   => 100058,
-            100  => 100059,
-            200  => 100060,
-        ],//山东
-        28 => [
-            30   => 100061,
-            50   => 100062,
-            100  => 100063,
-            200  => 100064,
-        ],//甘肃
-        24 => [
-            30   => 100065,
-            50   => 100066,
-            100  => 100067,
-            200  => 100068,
-        ],//贵州
+        mtopcard\ChinaMobileCard => [
+            30  => 100073,
+            50  => 100074,
+            100 => 100075,
+            200 => 100076,
+        ],
     ];
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
     const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
     const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];

+ 4 - 54
helper/refill/api/xyz/guantufs/商品编码.txt

@@ -1,54 +1,4 @@
-100025 四川移动分省30
-100026 四川移动分省50
-100027 四川移动分省100
-100028 四川移动分省200
-
-100029 福建移动分省30
-100030 福建移动分省50
-100031 福建移动分省100
-100032 福建移动分省200
-
-100033 云南移动分省30
-100034 云南移动分省50
-100035 云南移动分省100
-100036 云南移动分省200
-
-100037 浙江移动分省30
-100038 浙江移动分省50
-100039 浙江移动分省100
-100040 浙江移动分省200
-
-100049 山西移动分省30
-100050 山西移动分省50
-100051 山西移动分省100
-100052 山西移动分省200
-
-100045 陕西移动分省30
-100046 陕西移动分省50
-100047 陕西移动分省100
-100048 陕西移动分省200
-
-100041 江苏移动分省30
-100042 江苏移动分省50
-100043 江苏移动分省100
-100044 江苏移动分省200
-
-100053 湖北移动分省30
-100054 湖北移动分省50
-100055 湖北移动分省100
-100056 湖北移动分省200
-
-100057 山东移动分省30
-100058 山东移动分省50
-100059 山东移动分省100
-100060 山东移动分省200
-
-100061 甘肃移动分省30
-100062 甘肃移动分省50
-100063 甘肃移动分省100
-100064 甘肃移动分省200
-
-100065 贵州移动分省30
-100066 贵州移动分省50
-100067 贵州移动分省100
-100068 贵州移动分省200
+100073 移动分省30
+100074 移动分省50
+100075 移动分省100
+100076 移动分省200

+ 10 - 10
test/TestRefill.php

@@ -1406,16 +1406,16 @@ class TestRefill extends TestCase
 
 
     public function testGuantu()
     public function testGuantu()
     {
     {
-//        $provider = $this->getProvider('guantu');
+        $provider = $this->getProvider('guantu');
 //        $resp = $provider->balance();
 //        $resp = $provider->balance();
-//        $resp = $provider->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
-//        $resp = $provider->query(['order_sn' => '86151638846512034929']);
+//        $resp = $provider->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
+        $resp = $provider->query(['order_sn' => '82321639620607197216']);
 
 
-        $body = '{"orderId":"211207110843025294","appId":"sprTIuIsst","outOrderId":"86151638846512034929","sign":"a94dc11a88831c4cc9cf79cd2dc4b60c","orderStatus":"3","completeTime":"20211207110903","orderDesc":"\u8ba2\u5355\u5931\u8d25"}';
-        $params = json_decode($body, true);
-        $provider = $this->getProvider('guantu','RefillCallBack');
-        $ret = $provider->verify($params);
-        $resp = $provider->notify($params);
+//        $body = '{"orderId":"211207110843025294","appId":"sprTIuIsst","outOrderId":"86151638846512034929","sign":"a94dc11a88831c4cc9cf79cd2dc4b60c","orderStatus":"3","completeTime":"20211207110903","orderDesc":"\u8ba2\u5355\u5931\u8d25"}';
+//        $params = json_decode($body, true);
+//        $provider = $this->getProvider('guantu','RefillCallBack');
+//        $ret = $provider->verify($params);
+//        $resp = $provider->notify($params);
     }
     }
 
 
     public function testYiqian()
     public function testYiqian()
@@ -1555,9 +1555,9 @@ class TestRefill extends TestCase
 
 
     public function testGuantufs()
     public function testGuantufs()
     {
     {
-//        $provider = $this->getProvider('guantufs');
+        $provider = $this->getProvider('guantufs');
 //        $resp = $provider->balance();
 //        $resp = $provider->balance();
-//        $resp = $provider->add(1004638637, 4, 100, ['order_sn' => $this->make_sn()]);
+        $resp = $provider->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
 //        $resp = $provider->query(['order_sn' => '88791638870099595473']);
 //        $resp = $provider->query(['order_sn' => '88791638870099595473']);
     }
     }