瀏覽代碼

wangliantx

xiaoyu 3 年之前
父節點
當前提交
72fda80b0a

+ 16 - 16
data/config/win/refill.ini.php

@@ -2027,36 +2027,36 @@ $dianchong_phone = ['name' => 'dianchong', 'store_id' => 108, 'qualitys' => '1',
 $wangliantx_phone = ['name' => 'wangliantx', 'store_id' => 112,'qualitys' => '1',
     'amount' => [
         10 => [
-            ['goods_id' => 6979, 'price' => 9.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6979, 'price' => 9.47, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6979, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6979, 'price' => 9.52, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         20 => [
-            ['goods_id' => 6980, 'price' => 19, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6980, 'price' => 18.94, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6980, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6980, 'price' => 19.04, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         30 => [
-            ['goods_id' => 6981, 'price' => 28.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6981, 'price' => 28.41, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6981, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6981, 'price' => 28.56, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         50 => [
-            ['goods_id' => 6982, 'price' => 47.5, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6982, 'price' => 47.35, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6982, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6982, 'price' => 47.6, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         100 => [
-            ['goods_id' => 6983, 'price' => 95, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6983, 'price' => 94.7, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6983, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6983, 'price' => 95.2, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         200 => [
-            ['goods_id' => 6984, 'price' => 190, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6984, 'price' => 189.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6984, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6984, 'price' => 190.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         300 => [
-            ['goods_id' => 6985, 'price' => 285, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6985, 'price' => 284.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6985, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6985, 'price' => 285.6, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         500 => [
-            ['goods_id' => 6986, 'price' => 475, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6986, 'price' => 473.5, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6986, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6986, 'price' => 476, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];

+ 46 - 1
data/config/xyz/refill.ini.php

@@ -2024,6 +2024,43 @@ $dianchong_phone = ['name' => 'dianchong', 'store_id' => 108, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$wangliantx_phone = ['name' => 'wangliantx', 'store_id' => 112,'qualitys' => '1',
+    'amount' => [
+        10 => [
+            ['goods_id' => 6979, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6979, 'price' => 9.52, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 6980, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6980, 'price' => 19.04, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 6981, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6981, 'price' => 28.56, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6982, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6982, 'price' => 47.6, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6983, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6983, 'price' => 95.2, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6984, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6984, 'price' => 190.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6985, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6985, 'price' => 285.6, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 6986, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6986, 'price' => 476, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2103,7 +2140,8 @@ $phone_providers = [
     ['name' => 'xinyang', 'cfg' => $xinyang_phone],
     ['name' => 'guochuang', 'cfg' => $guochuang_phone],
     ['name' => 'xianghongrui', 'cfg' => $xianghongrui_phone],
-    ['name' => 'dianchong', 'cfg' => $dianchong_phone]
+    ['name' => 'dianchong', 'cfg' => $dianchong_phone],
+    ['name' => 'wangliantx', 'cfg' => $wangliantx_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 
@@ -2115,8 +2153,15 @@ $lingzhthird = ['name' => 'lingzhthird', 'store_id' => 52,'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$jumithird = ['name' => 'jumithird', 'store_id' => 111,'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 6978, 'price' => 99, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $third_providers = [
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
+//    ['name' => 'jumithird', 'cfg' => $jumithird],
 ];
 $config['third_providers'] = $third_providers;
 

+ 46 - 1
data/config/xyzadm/refill.ini.php

@@ -2024,6 +2024,43 @@ $dianchong_phone = ['name' => 'dianchong', 'store_id' => 108, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$wangliantx_phone = ['name' => 'wangliantx', 'store_id' => 112,'qualitys' => '1',
+    'amount' => [
+        10 => [
+            ['goods_id' => 6979, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6979, 'price' => 9.52, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        20 => [
+            ['goods_id' => 6980, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6980, 'price' => 19.04, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        30 => [
+            ['goods_id' => 6981, 'price' => 28.65, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6981, 'price' => 28.56, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6982, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6982, 'price' => 47.6, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6983, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6983, 'price' => 95.2, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6984, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6984, 'price' => 190.4, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 6985, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6985, 'price' => 285.6, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 6986, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6986, 'price' => 476, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2103,7 +2140,8 @@ $phone_providers = [
     ['name' => 'xinyang', 'cfg' => $xinyang_phone],
     ['name' => 'guochuang', 'cfg' => $guochuang_phone],
     ['name' => 'xianghongrui', 'cfg' => $xianghongrui_phone],
-    ['name' => 'dianchong', 'cfg' => $dianchong_phone]
+    ['name' => 'dianchong', 'cfg' => $dianchong_phone],
+    ['name' => 'wangliantx', 'cfg' => $wangliantx_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 
@@ -2115,8 +2153,15 @@ $lingzhthird = ['name' => 'lingzhthird', 'store_id' => 52,'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$jumithird = ['name' => 'jumithird', 'store_id' => 111,'qualitys' => '1',
+    'amount' => [
+        100 => [['goods_id' => 6978, 'price' => 99, 'quality' => 1, 'card_type' => 'third']],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $third_providers = [
     ['name' => 'lingzhthird', 'cfg' => $lingzhthird],
+//    ['name' => 'jumithird', 'cfg' => $jumithird],
 ];
 $config['third_providers'] = $third_providers;
 

+ 2 - 2
helper/refill/api/xyz/wangliantx/RefillCallBack.php

@@ -23,7 +23,7 @@ class RefillCallBack implements refill\IRefillCallBack
         $key = config::KEY;
         $content = "userid={$userid}&orderid={$params['orderid']}&sporderid={$params['sporderid']}&merchantsubmittime={$params['merchantsubmittime']}";
         $content .= "&resultno={$params['resultno']}&key={$key}";
-        return strtoupper(md5($content));
+        return md5($content);
     }
 
     public function notify($params)
@@ -37,7 +37,7 @@ class RefillCallBack implements refill\IRefillCallBack
         $order_id = $order_info['order_id'];
 
         if ($status === 1) {
-            $data['official_sn'] = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+            $data['official_sn'] = strtolower($params['supnumber']) == 'null' ? '' : $params['supnumber'];
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false,true];
         }

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

@@ -60,10 +60,14 @@ class RefillPhone extends refill\IRefillPhone
             $resultno = intval($resp['resultno']);
             if (in_array($resultno, [0, 1, 2])) {
                 return [true, $resp['orderid'], false];
+            } elseif (in_array($resultno, config::ERR_NO)) {
+                return [false, $resultno, false];
             } elseif ($resultno === 9999) {
                 $net_errno = "HTTP-{$resultno}";
                 return [false, $resultno, false];
             } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
                 return [false, $resultno, false];
             }
         }
@@ -91,7 +95,7 @@ class RefillPhone extends refill\IRefillPhone
             {
                 $resultno = intval($resp['resultno']);
                 if ($resultno === 1) {
-                    $updata['official_sn'] = $resp['remark1'];
+                    $updata['official_sn'] = $resp['supnumber'];
                     Model('refill_order')->edit($refill_info['order_id'], $updata);
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($resultno === 9) {

+ 4 - 2
helper/refill/api/xyz/wangliantx/config.php

@@ -12,11 +12,13 @@ class config
 
     const USER_ID= '10073664';
     const KEY = 'ADE28CAF69A0FFE7E5E3C5FD5EBCA7F9';
-//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_wangliantx.php";
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_wangliantx.php";
     const operator = [
         mtopcard\ChinaMobileCard  => '移动',
         mtopcard\ChinaUnicomCard  => '联通',
         mtopcard\ChinaTelecomCard => '电信'
     ];
+    const ERR_NO = [
+        '9','1001','5001','5002','5003','5004','5005','5006','5007','5008','5009','5010','5011','5012','5013','5014','5015'
+    ];
 }

+ 4 - 0
mobile/callback/refill_wangliantx.php

@@ -0,0 +1,4 @@
+<?php
+
+refill\util::push_notify('wangliantx',$_POST);
+echo ('SUCCESS');

+ 14 - 6
test/TestRefill.php

@@ -758,13 +758,21 @@ class TestRefill extends TestCase
 
     public function testWangliantx()
     {
-        $providers = $this->getProvider('wangliantx');
+//        $providers = $this->getProvider('wangliantx');
 //        $resp = $providers->balance();
-//        $resp = $providers->add(18500608333, 5, 30, [
-//            'order_sn' => $this->make_sn(),
-//            'regin_no' => 1
-//        ]);
-        $resp = $providers->query(['order_sn' => '68241629799006092369']);
+//        for ($i = 1; $i<=1; $i++){
+//            $resp = $providers->add(18074608795, 6, 50, [
+//                'order_sn' => $this->make_sn(),
+//                'regin_no' => 1
+//            ]);
+//        }
+//        $resp = $providers->query(['order_sn' => '85901629801033376170']);
+
+        $body = '{"userid":"10073664","sporderid":"85901629801033376170","orderid":"C5C5D4F49DB61A8773664","resultno":"1","merchantsubmittime":"20210824183109","ordermoney":"47.6","verifystring":"b6a873ecd6dc9cea3a410c6386cdab84","sign":"4a80e2a8c7b07c8aacada4feedd581bd","supnumber":"1000000083421082418345386156"}';
+        $params = json_decode($body, true);
+        $providers = $this->getProvider('wangliantx','RefillCallBack');
+        $ret = $providers->verify($params);
+        $resp = $providers->notify($params);
     }
 
     public function testAmingjd()