xiaoyu 3 роки тому
батько
коміт
a1c7ae9e6a

+ 31 - 1
data/config/win/refill.ini.php

@@ -1115,6 +1115,35 @@ $fengyeman24_phone = ['name' => 'fengyeman24', 'store_id' => 68, 'qualitys' => '
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$moxj_yd_phone = ['name' => 'moxj_yd', 'store_id' => 69, 'qualitys' => '1',
+    'amount' => [
+        10 => [
+            ['goods_id' => 6676, 'price' => 9.48, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        20 => [
+            ['goods_id' => 6677, 'price' => 18.96, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        30 => [
+            ['goods_id' => 6678, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        50 => [
+            ['goods_id' => 6679, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        100 => [
+            ['goods_id' => 6680, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        200 => [
+            ['goods_id' => 6681, 'price' => 189.6, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        300 => [
+            ['goods_id' => 6682, 'price' => 284.4, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+        500 => [
+            ['goods_id' => 6683, 'price' => 474, 'quality' => 1, 'card_type' => 'chinamobile']
+        ],
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -1158,7 +1187,8 @@ $phone_providers = [
     ['name' => 'moxj_fs', 'cfg' => $moxj_fs_phone],
     ['name' => 'zanzanquick', 'cfg' => $zanzanquick_phone],
     ['name' => 'fengyeman', 'cfg' => $fengyeman_phone],
-    ['name' => 'fengyeman24', 'cfg' => $fengyeman24_phone]
+    ['name' => 'fengyeman24', 'cfg' => $fengyeman24_phone],
+    ['name' => 'moxj_yd', 'cfg' => $moxj_yd_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

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

@@ -1187,7 +1187,8 @@ $phone_providers = [
     ['name' => 'moxj_fs', 'cfg' => $moxj_fs_phone],
     ['name' => 'zanzanquick', 'cfg' => $zanzanquick_phone],
     ['name' => 'fengyeman', 'cfg' => $fengyeman_phone],
-    ['name' => 'fengyeman24', 'cfg' => $fengyeman24_phone]
+    ['name' => 'fengyeman24', 'cfg' => $fengyeman24_phone],
+    ['name' => 'moxj_yd', 'cfg' => $moxj_yd_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 1 - 1
helper/refill/api/xyz/moxj_yd/RefillPhone.php

@@ -17,7 +17,7 @@ class RefillPhone extends refill\IRefillPhone
     private function req_params(int $phone, int $amount, string $order_sn)
     {
         $params['customer_order_no'] = $order_sn;
-        $params['recharge_phone'] = $phone;
+        $params['recharge_phone'] = "{$phone}";
         $params['recharge_money'] = $amount;
         $params['order_notify_url'] = config::NOTIFY_URL;
         $params['merchant_id'] = config::MCH_ID;

+ 3 - 1
mobile/callback/refill_moxj_yd.php

@@ -1,6 +1,8 @@
 <?php
+$content = $_SERVER['post_content'];
+$input = json_decode($content,true);
+refill\util::push_notify('moxj_yd',$input);
 
-refill\util::push_notify('moxj_yd',$_POST);
 $response = ["code" => "0"];
 $body = json_encode($response);
 echo($body);

+ 10 - 0
test/TestRefill.php

@@ -389,6 +389,16 @@ class TestRefill extends TestCase
         refill\RefillFactory::instance()->notify('fengyeman',$params);
     }
 
+    public function testMoxj_ydPhone()
+    {
+        $providers = new refill\moxj_yd\RefillPhone([]);
+        $resp = $providers->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '52101624413125875436']);
+        $data = '{"customer_order_no":"47651624412877257722","status":1,"merchant_id":"76505818","sign":"c185a0f2152b3ac3ee3f29009dec5a6b"}';
+        $params = json_decode($data , true);
+//        refill\RefillFactory::instance()->notify('moxj_yd',$params);
+    }
+
     public function testTongluPhone()
     {
         $providers = new refill\tonglu\RefillPhone([]);