xiaoyu 3 anos atrás
pai
commit
0b0b9a2e06

+ 14 - 0
data/config/win/refill.ini.php

@@ -2616,6 +2616,19 @@ $menggu_hf_phone = ['name' => 'menggu_hf', 'store_id' => 131,'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$duojing_phone = ['name' => 'duojing', 'store_id' => 132, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 7139, 'price' => 9.97, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 7140, 'price' => 19.94, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        30 => [['goods_id' => 7141, 'price' => 29.91, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7142, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7143, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7144, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        300 => [['goods_id' => 7145, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        500 => [['goods_id' => 7146, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2715,6 +2728,7 @@ $phone_providers = [
     ['name' => 'dashang', 'cfg' => $dashang_phone],
     ['name' => 'yuanta', 'cfg' => $yuanta_phone],
     ['name' => 'menggu_hf', 'cfg' => $menggu_hf_phone],
+    ['name' => 'duojing', 'cfg' => $duojing_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 14 - 0
data/config/xyz/refill.ini.php

@@ -2616,6 +2616,19 @@ $menggu_hf_phone = ['name' => 'menggu_hf', 'store_id' => 131,'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$duojing_phone = ['name' => 'duojing', 'store_id' => 132, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 7139, 'price' => 9.97, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 7140, 'price' => 19.94, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        30 => [['goods_id' => 7141, 'price' => 29.91, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7142, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7143, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7144, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        300 => [['goods_id' => 7145, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        500 => [['goods_id' => 7146, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2715,6 +2728,7 @@ $phone_providers = [
     ['name' => 'dashang', 'cfg' => $dashang_phone],
     ['name' => 'yuanta', 'cfg' => $yuanta_phone],
     ['name' => 'menggu_hf', 'cfg' => $menggu_hf_phone],
+    ['name' => 'duojing', 'cfg' => $duojing_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 14 - 0
data/config/xyzadm/refill.ini.php

@@ -2616,6 +2616,19 @@ $menggu_hf_phone = ['name' => 'menggu_hf', 'store_id' => 131,'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$duojing_phone = ['name' => 'duojing', 'store_id' => 132, 'qualitys' => '2',
+    'amount' => [
+//        10 => [['goods_id' => 7139, 'price' => 9.97, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        20 => [['goods_id' => 7140, 'price' => 19.94, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        30 => [['goods_id' => 7141, 'price' => 29.91, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 7142, 'price' => 49.85, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 7143, 'price' => 99.7, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 7144, 'price' => 199.4, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        300 => [['goods_id' => 7145, 'price' => 299.1, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+//        500 => [['goods_id' => 7146, 'price' => 498.5, 'quality' => 2, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -2715,6 +2728,7 @@ $phone_providers = [
     ['name' => 'dashang', 'cfg' => $dashang_phone],
     ['name' => 'yuanta', 'cfg' => $yuanta_phone],
     ['name' => 'menggu_hf', 'cfg' => $menggu_hf_phone],
+    ['name' => 'duojing', 'cfg' => $duojing_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 2 - 2
helper/refill/api/xyz/duojing/RefillPhone.php

@@ -59,7 +59,7 @@ class RefillPhone extends refill\IRefillPhone
         $sign = $this->sign($params);
         $params['sign'] = $sign;
 
-        $resp = http_post_data(config::QUERY_URL, $params,);
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
 
         if (empty($resp)) {
             return [false, '网络错误'];
@@ -103,7 +103,7 @@ class RefillPhone extends refill\IRefillPhone
         $sign = $this->sign($params);
         $params['sign'] = $sign;
 
-        $resp = http_post_data(config::BALANCE_URL, $params,);
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
         if(empty($resp)) {
             return [false, '网络错误'];
         }else{

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

@@ -9,7 +9,6 @@ class config
 
     const appKey= '30000419';
     const KEY = 'YpSWT1qwMnKTWAD0pLhF_Ev9BBUs2INV';
-//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_duojing.php";
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_duojing.php";
     const ExtHeaders = ['Content-Type: application/x-www-form-urlencoded'];
 }

+ 4 - 0
mobile/callback/refill_duojing.php

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

+ 9 - 3
test/TestRefill.php

@@ -1029,10 +1029,16 @@ class TestRefill extends TestCase
 
     public function testDuojing()
     {
-        $providers = $this->getProvider('duojing');
+//        $providers = $this->getProvider('duojing');
 //        $resp = $providers->balance();
-        $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
-//        $resp = $providers->query(['order_sn' => '61501631786913519186']);
+//        $resp = $providers->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '24731632377651122245']);
+
+        $body = '{"appKey":"30000419","number":"56521092314142544365","orderId":"24731632377651122245","mobile":"18500608333","reason":"","amount":"50.00","actualAmount":"49.85","createdAt":"2021-09-23 14:14:25","status":"SUCCESS","sign":"8D7A526CF3F6C1279BD1819028B7683A"}';
+        $params = json_decode($body, true);
+        $providers = $this->getProvider('duojing','RefillCallBack');
+        $ret = $providers->verify($params);
+        $resp = $providers->notify($params);
     }
 
     public function testMenggu()