Browse Source

odify lifang

zb727 1 year ago
parent
commit
3fb59a10da

+ 43 - 21
data/config/mh/refill.ini.php

@@ -61,27 +61,52 @@ $dixin_slow = ['name' => 'dixin_slow', 'store_id' => 382,'qualitys' => '1',
     'official_sn' => true, 'refill_type' => 'api'];
 
 
-$suhu_normal = ['name' => 'suhu_normal', 'store_id' => 379,'qualitys' => '1',
+$lifang_normal = ['name' => 'lifang_normal', 'store_id' => 384,'qualitys' => '2',
+    'amount' => [
+        30 => [
+            ['goods_id' => 8950, 'price' => 29.4, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8950, 'price' => 29.4, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8950, 'price' => 29.4, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8951, 'price' => 49,'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8951, 'price' => 49, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8951, 'price' => 49,   'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8952, 'price' => 98, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8952, 'price' => 98, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8952, 'price' => 98, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8953, 'price' => 196.0, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8953, 'price' => 196.0, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8953, 'price' => 196.0, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$suhu_normal = ['name' => 'suhu_normal', 'store_id' => 379,'qualitys' => '2',
     'amount' => [
        20 => [
-            ['goods_id' => 8949, 'price' => 19.896, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8949, 'price' => 19.896, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
 
         30 => [
-            ['goods_id' => 8950, 'price' => 30.09, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8950, 'price' => 29.844, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8950, 'price' => 30.009, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 8950, 'price' => 30.090, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8950, 'price' => 29.844, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8950, 'price' => 30.009, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
 
         50 => [
-            ['goods_id' => 8951, 'price' => 50.15,'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8951, 'price' => 49.47, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8951, 'price' => 50.15,   'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 8951, 'price' => 50.15,'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8951, 'price' => 49.47,'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8951, 'price' => 50.15,'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         100 => [
-            ['goods_id' => 8952, 'price' => 100.1, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 8952, 'price' => 98.7, 'quality' => 1, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 8952, 'price' => 100.3, 'quality' => 1, 'card_type' => 'chinatelecom']
+            ['goods_id' => 8952, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8952, 'price' =>  98.7, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8952, 'price' => 100.3, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -99,27 +124,23 @@ $suhu_wozhifu = ['name' => 'suhu_wozhifu', 'store_id' => 380,'qualitys' => '2',
         200 => [
             ['goods_id' => 8953, 'price' => 199.76, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
-
         300 => [
             ['goods_id' => 8955, 'price' => 299.64, 'quality' => 2, 'card_type' => 'chinaunicom'],
         ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
-$weisanhuo_normal = ['name' => 'weisanhuo_normal', 'store_id' => 383, 'qualitys' => '1',
+$weisanhuo_normal = ['name' => 'weisanhuo_normal', 'store_id' => 383, 'qualitys' => '2',
     'amount' => [
+        50 => [
+            ['goods_id' => 8951, 'price' => 47.6,'quality' => 2, 'card_type' => 'chinamobile'],
+        ],
         100 => [
-            ['goods_id' => 9013, 'price' => 95.2,   'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9013, 'price' => 95.2,   'quality' => 2, 'card_type' => 'chinamobile'],
         ],
         200 => [
-            ['goods_id' => 9014, 'price' => 190.4,  'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9014, 'price' => 190.4,  'quality' => 2, 'card_type' => 'chinamobile'],
         ],
-        300 => [
-            ['goods_id' => 9015, 'price' => 285.6,  'quality' => 1, 'card_type' => 'chinamobile'],
-        ],
-        500 => [
-            ['goods_id' => 9016, 'price' => 476,    'quality' => 1, 'card_type' => 'chinamobile'],
-        ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
@@ -158,6 +179,7 @@ $yushang_normal = ['name' => 'yushang_normal', 'store_id' => 381,'qualitys' => '
 $phone_providers = [
     ['name' => 'dixin_normal', 'cfg' => $dixin_normal],
     ['name' => 'dixin_slow', 'cfg' => $dixin_slow],
+    ['name' => 'lifang_normal', 'cfg' => $lifang_normal],
     ['name' => 'suhu_normal', 'cfg' => $suhu_normal],
     ['name' => 'suhu_wozhifu', 'cfg' => $suhu_wozhifu],
     ['name' => 'weisanhuo_normal', 'cfg' => $weisanhuo_normal],

BIN
helper/refill/api/mh/weisanhuo_normal/code.xlsx


+ 18 - 18
helper/refill/api/mh/weisanhuo_normal/config.php

@@ -16,27 +16,27 @@ class config
     const ProductIdS = [
         mtopcard\ChinaMobileCard =>
             [
-                30 => 'k-yd-30',
+                30 => 'cshf1',  //测试
                 50 => 'k-yd-50',
                 100 => 'k-yd-100',
-                200 => 'k-yd-200',
-                300 => 'k-yd-300',
-                500 => 'k-yd-500'
+                200 => 'k-yd-200'
+                //300 => 'k-yd-300',
+               // 500 => 'k-yd-500'
             ],
-        mtopcard\ChinaUnicomCard =>
-            [
-                30 => 'k-lt-30',
-                50 => 'k-lt-50',
-                100 => 'k-lt-100',
-                200 => 'k-lt-200'
-            ],
-        mtopcard\ChinaTelecomCard =>
-            [
-                30 => 'k-dx-30',
-                50 => 'k-dx-50',
-                100 => 'k-dx-100',
-                200 => 'k-dx-200'
-            ]
+//        mtopcard\ChinaUnicomCard =>
+//            [
+//                30 => 'k-lt-30',
+//                50 => 'k-lt-50',
+//                100 => 'k-lt-100',
+//                200 => 'k-lt-200'
+//            ],
+//        mtopcard\ChinaTelecomCard =>
+//            [
+//                30 => 'k-dx-30',
+//                50 => 'k-dx-50',
+//                100 => 'k-dx-100',
+//                200 => 'k-dx-200'
+//            ]
     ];
 
     public static function sign(array $params, array $ignore = []): string

+ 21 - 3
test/mh/TestRefill.php

@@ -95,9 +95,9 @@ class TestRefill extends TestCase
     {
         $provider = $this->getProvider('lifang_normal');
         $order_sn = $this->make_sn();
-        $resp = $provider->add(15652921127, 5, 30, ['order_sn' => $order_sn, 'regin_no' => 1]);
-        $resp = $provider->query(['order_sn' => $order_sn]);
-        $resp = $provider->balance();
+       // $resp = $provider->add(15652921127, 5, 30, ['order_sn' => $order_sn, 'regin_no' => 1]);
+       // $resp = $provider->query(['order_sn' => $order_sn]);
+       // $resp = $provider->balance();
     }
 
     public function testLifangCB()
@@ -109,6 +109,24 @@ class TestRefill extends TestCase
         $provider->notify($content);
     }
 
+    public function testWensanhuo()
+    {
+        $provider = $this->getProvider('weisanhuo_normal');
+        $order_sn = $this->make_sn();
+        //$resp = $provider->add(18855414101, 4, 30, ['order_sn' => $order_sn, 'regin_no' => 1]);//30为测试产品
+        //$resp = $provider->query(['order_sn' => $order_sn]);
+        $resp = $provider->balance();
+    }
+
+    public function testWensanhuoCB()
+    {
+        $_POST='{"orderId":"S23112800025098","outOrderId":"60201701159853851187","requestDate":"20231128164156","sign":"E172D40D040D26C8226E237ACED8C861","accessToken":"beaf87f8-7c6b-cb8a-98b8-53c207ca9aef","status":"1"}';
+        $content = json_decode($_POST,true);
+        $provider = $this->getProvider('lifang_normal','RefillCallBack');
+        $provider->verify($content);
+        $provider->notify($content);
+    }
+
     public function testJson()
     {
         $val = json_encode(['account' => '13911129867']);