xiaoyu 3 năm trước cách đây
mục cha
commit
291022aaf9

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

@@ -3546,6 +3546,19 @@ $baixuan_normal_phone = ['name' => 'baixuan_normal', 'store_id' => 165,'qualitys
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$cangbuyd_phone = ['name' => 'cangbuyd', 'store_id' => 166, 'qualitys' => '1',
+    'amount' => [
+//        10 => [['goods_id' => 7406, 'price' => 9.59, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        20 => [['goods_id' => 7407, 'price' => 19.18, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        30 => [['goods_id' => 7408, 'price' => 28.77, 'quality' => 1, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 7409, 'price' => 47.95, 'quality' => 1, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 7410, 'price' => 95.9, 'quality' => 1, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 7411, 'price' => 191.8, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        300 => [['goods_id' => 7412, 'price' => 287.7, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        500 => [['goods_id' => 7413, 'price' => 479.5, 'quality' => 1, 'card_type' => 'chinamobile']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -3675,6 +3688,7 @@ $phone_providers = [
     ['name' => 'dongyefs', 'cfg' => $dongyefs_phone],
     ['name' => 'baixuan', 'cfg' => $baixuan_phone],
     ['name' => 'baixuan_normal', 'cfg' => $baixuan_normal_phone],
+    ['name' => 'cangbuyd', 'cfg' => $cangbuyd_phone],
 ];
 $config['phone_providers'] = $phone_providers;
 

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

@@ -3546,6 +3546,19 @@ $baixuan_normal_phone = ['name' => 'baixuan_normal', 'store_id' => 165,'qualitys
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$cangbuyd_phone = ['name' => 'cangbuyd', 'store_id' => 166, 'qualitys' => '1',
+    'amount' => [
+//        10 => [['goods_id' => 7406, 'price' => 9.59, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        20 => [['goods_id' => 7407, 'price' => 19.18, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        30 => [['goods_id' => 7408, 'price' => 28.77, 'quality' => 1, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 7409, 'price' => 47.95, 'quality' => 1, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 7410, 'price' => 95.9, 'quality' => 1, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 7411, 'price' => 191.8, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        300 => [['goods_id' => 7412, 'price' => 287.7, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        500 => [['goods_id' => 7413, 'price' => 479.5, 'quality' => 1, 'card_type' => 'chinamobile']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -3675,6 +3688,7 @@ $phone_providers = [
     ['name' => 'dongyefs', 'cfg' => $dongyefs_phone],
     ['name' => 'baixuan', 'cfg' => $baixuan_phone],
     ['name' => 'baixuan_normal', 'cfg' => $baixuan_normal_phone],
+    ['name' => 'cangbuyd', 'cfg' => $cangbuyd_phone],
 ];
 $config['phone_providers'] = $phone_providers;
 

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

@@ -3546,6 +3546,19 @@ $baixuan_normal_phone = ['name' => 'baixuan_normal', 'store_id' => 165,'qualitys
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$cangbuyd_phone = ['name' => 'cangbuyd', 'store_id' => 166, 'qualitys' => '1',
+    'amount' => [
+//        10 => [['goods_id' => 7406, 'price' => 9.59, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        20 => [['goods_id' => 7407, 'price' => 19.18, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        30 => [['goods_id' => 7408, 'price' => 28.77, 'quality' => 1, 'card_type' => 'chinamobile']],
+        50 => [['goods_id' => 7409, 'price' => 47.95, 'quality' => 1, 'card_type' => 'chinamobile']],
+        100 => [['goods_id' => 7410, 'price' => 95.9, 'quality' => 1, 'card_type' => 'chinamobile']],
+        200 => [['goods_id' => 7411, 'price' => 191.8, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        300 => [['goods_id' => 7412, 'price' => 287.7, 'quality' => 1, 'card_type' => 'chinamobile']],
+//        500 => [['goods_id' => 7413, 'price' => 479.5, 'quality' => 1, 'card_type' => 'chinamobile']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -3675,6 +3688,7 @@ $phone_providers = [
     ['name' => 'dongyefs', 'cfg' => $dongyefs_phone],
     ['name' => 'baixuan', 'cfg' => $baixuan_phone],
     ['name' => 'baixuan_normal', 'cfg' => $baixuan_normal_phone],
+    ['name' => 'cangbuyd', 'cfg' => $cangbuyd_phone],
 ];
 $config['phone_providers'] = $phone_providers;
 

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

@@ -12,8 +12,7 @@ class config
 
     const MCH_ID= '220';
     const KEY = '5lEtcVlnQJpEObGYPJF6qf0SqJObB0';
-//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_cangbuyd.php";
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_cangbuyd.php";
     const operator = [
         mtopcard\ChinaMobileCard  => 'MOBILE',
         mtopcard\ChinaUnicomCard  => 'UNICOM',

+ 4 - 0
mobile/callback/refill_cangbuyd.php

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

+ 9 - 3
test/TestRefill.php

@@ -1527,10 +1527,16 @@ class TestRefill extends TestCase
 
     public function testCangbuYd()
     {
-        $provider = $this->getProvider('cangbuyd');
+//        $provider = $this->getProvider('cangbuyd');
 //        $resp = $provider->balance();
-        $resp = $provider->add(13699279618, 4, 30, ['order_sn' => $this->make_sn()]);
-//        $resp = $provider->query(['order_sn' => '79931638775980503797']);
+//        $resp = $provider->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
+//        $resp = $provider->query(['order_sn' => '12441638778449837197']);
+
+        $body = '{"customerId":"220","tmporder":"12441638778449837197","orderno":"s16387784558073061114220","number":"13699279618","money":"50","amount":"47.9500","code":"-1","cardno":"","voucher":"","sign":"6623dbe8e392b61ddc843e16804e9eed"}';
+        $params = json_decode($body, true);
+        $provider = $this->getProvider('cangbuyd','RefillCallBack');
+        $ret = $provider->verify($params);
+        $resp = $provider->notify($params);
     }
 
     public function testAmingjd()