Explorar o código

yunchonggongfs add dx

xiaoyu %!s(int64=2) %!d(string=hai) anos
pai
achega
843c3217ef

+ 4 - 4
data/config/xyz/refill.ini.php

@@ -3267,10 +3267,10 @@ $yunchonggongfs_phone = ['name' => 'yunchonggongfs', 'store_id' => 149,'qualitys
     'amount' => [
 //        10 => [['goods_id' => 7275, 'price' => 9.41, 'quality' => 1, 'card_type' => 'chinamobile']],
 //        20 => [['goods_id' => 7276, 'price' => 18.82, 'quality' => 1, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 7277, 'price' => 28.23, 'quality' => 1, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 7278, 'price' => 47.05, 'quality' => 1, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 7279, 'price' => 94.1, 'quality' => 1, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 7280, 'price' => 188.2, 'quality' => 1, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 7277, 'price' => 28.23, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        50 => [['goods_id' => 7278, 'price' => 47.05, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        100 => [['goods_id' => 7279, 'price' => 94.1, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        200 => [['goods_id' => 7280, 'price' => 188.2, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
 //        300 => [['goods_id' => 7281, 'price' => 282.3, 'quality' => 1, 'card_type' => 'chinamobile']],
 //        500 => [['goods_id' => 7282, 'price' => 470.5, 'quality' => 1, 'card_type' => 'chinamobile']]
     ],

+ 4 - 4
data/config/yl/refill.ini.php

@@ -3277,10 +3277,10 @@ $yunchonggongfs_phone = ['name' => 'yunchonggongfs', 'store_id' => 149,'qualitys
     'amount' => [
 //        10 => [['goods_id' => 7275, 'price' => 9.41, 'quality' => 1, 'card_type' => 'chinamobile']],
 //        20 => [['goods_id' => 7276, 'price' => 18.82, 'quality' => 1, 'card_type' => 'chinamobile']],
-        30 => [['goods_id' => 7277, 'price' => 28.23, 'quality' => 1, 'card_type' => 'chinamobile']],
-        50 => [['goods_id' => 7278, 'price' => 47.05, 'quality' => 1, 'card_type' => 'chinamobile']],
-        100 => [['goods_id' => 7279, 'price' => 94.1, 'quality' => 1, 'card_type' => 'chinamobile']],
-        200 => [['goods_id' => 7280, 'price' => 188.2, 'quality' => 1, 'card_type' => 'chinamobile']],
+        30 => [['goods_id' => 7277, 'price' => 28.23, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        50 => [['goods_id' => 7278, 'price' => 47.05, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        100 => [['goods_id' => 7279, 'price' => 94.1, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
+        200 => [['goods_id' => 7280, 'price' => 188.2, 'quality' => 1, 'card_type' => 'chinamobile,chinatelecom']],
 //        300 => [['goods_id' => 7281, 'price' => 282.3, 'quality' => 1, 'card_type' => 'chinamobile']],
 //        500 => [['goods_id' => 7282, 'price' => 470.5, 'quality' => 1, 'card_type' => 'chinamobile']]
     ],

+ 3 - 3
helper/refill/api/xyz/yunchonggongfs/RefillPhone.php

@@ -28,12 +28,12 @@ class RefillPhone extends refill\IRefillPhone
         }
     }
 
-    private function req_params(int $phone, int $amount, string $order_sn, $regin_no)
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn, $regin_no)
     {
         $params['appId'] = config::APP_ID;
         $params['outOrderId'] = $order_sn;
         $params['uuid'] = $phone;
-        $params['itemId'] = config::ProvinceItemId[$regin_no][$amount];
+        $params['itemId'] = config::ProvinceItemId[$card_type][$regin_no][$amount];
         $params['itemFace'] = $amount;
         $params['amount'] = 1;
         $params['callbackUrl'] = config::NOTIFY_URL;
@@ -48,7 +48,7 @@ class RefillPhone extends refill\IRefillPhone
         if($regin_no <= 0) {
             return [false, '省份获取错误', false];
         }
-        $params = $this->req_params($card_no, $amount, $order_sn, $regin_no);
+        $params = $this->req_params($card_no, $card_type, $amount, $order_sn, $regin_no);
         if(empty($params['itemId'])) {
             return [false, '商品编号错误', false];
         }

+ 34 - 12
helper/refill/api/xyz/yunchonggongfs/config.php

@@ -3,6 +3,7 @@
 
 namespace refill\yunchonggongfs;
 
+use mtopcard;
 class config
 {
     const ORDER_URL = 'http://39.108.50.235:8911/api/order/submit';
@@ -14,24 +15,45 @@ class config
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yunchonggongfs.php";
 
     const ProvinceItemId = [
-        25	=> [
-                    30  => 100012,
-                    50  => 100013,
-                    100 => 100014,
-                    200 => 100015
-                ], //'云南',
-        24	=> [
-                    30  => 100016,
-                    50  => 100017,
-                    100 => 100018,
-                    200 => 100019
-                ], //'贵州',
+        mtopcard\ChinaMobileCard => [
+            25	=> [
+                30  => 100012,
+                50  => 100013,
+                100 => 100014,
+                200 => 100015
+            ], //'云南',
+            24	=> [
+                30  => 100016,
+                50  => 100017,
+                100 => 100018,
+                200 => 100019
+            ], //'贵州',
+        ],
+        mtopcard\ChinaTelecomCard => [
+            9	=> [
+                30  => 100024,
+                50  => 100025,
+                100 => 100026,
+                200 => 100027
+            ], //'上海',
+            18	=> [
+                30  => 100024,
+                50  => 100025,
+                100 => 100026,
+                200 => 100027
+            ], //'湖南',
+        ]
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
     const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
     //key格式 卡类型-面值-regin_no
     const Price = [
+        //移动
         "4-30-24" => 28.23, "4-50-24" => 47.05, "4-100-24" => 94.1, "4-200-24" => 188.2,//贵州 24
         "4-30-25" => 28.23, "4-50-25" => 47.05, "4-100-25" => 94.1, "4-200-25" => 188.2,//云南 25
+
+        //电信
+        "6-30-9" => 28.23, "6-50-9" => 47.05, "6-100-9" => 94.1, "6-200-9" => 188.2,//上海 9
+        "6-30-18" => 28.23, "6-50-18" => 47.05, "6-100-18" => 94.1, "6-200-18" => 188.2,//湖南 18
     ];
 }

+ 10 - 0
helper/refill/api/xyz/yunchonggongfs/开户信息.txt

@@ -22,3 +22,13 @@ appSecret:LSBNkvMPKoAMfDrt
 100017	贵州移动50
 100018	贵州移动100
 100019	贵州移动200
+
+
+100024
+分省电信30
+100025
+分省电信50
+100026
+分省电信100
+100027
+分省电信200

+ 3 - 3
helper/refill/api/yl/yunchonggongfs/RefillPhone.php

@@ -28,12 +28,12 @@ class RefillPhone extends refill\IRefillPhone
         }
     }
 
-    private function req_params(int $phone, int $amount, string $order_sn, $regin_no)
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn, $regin_no)
     {
         $params['appId'] = config::APP_ID;
         $params['outOrderId'] = $order_sn;
         $params['uuid'] = $phone;
-        $params['itemId'] = config::ProvinceItemId[$regin_no][$amount];
+        $params['itemId'] = config::ProvinceItemId[$card_type][$regin_no][$amount];
         $params['itemFace'] = $amount;
         $params['amount'] = 1;
         $params['callbackUrl'] = config::NOTIFY_URL;
@@ -48,7 +48,7 @@ class RefillPhone extends refill\IRefillPhone
         if($regin_no <= 0) {
             return [false, '省份获取错误', false];
         }
-        $params = $this->req_params($card_no, $amount, $order_sn, $regin_no);
+        $params = $this->req_params($card_no, $card_type, $amount, $order_sn, $regin_no);
         if(empty($params['itemId'])) {
             return [false, '商品编号错误', false];
         }

+ 34 - 12
helper/refill/api/yl/yunchonggongfs/config.php

@@ -3,6 +3,7 @@
 
 namespace refill\yunchonggongfs;
 
+use mtopcard;
 class config
 {
     const ORDER_URL = 'http://39.108.50.235:8911/api/order/submit';
@@ -14,24 +15,45 @@ class config
     const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yunchonggongfs.php";
 
     const ProvinceItemId = [
-        25	=> [
-            30  => 100012,
-            50  => 100013,
-            100 => 100014,
-            200 => 100015
-        ], //'云南',
-        24	=> [
-            30  => 100016,
-            50  => 100017,
-            100 => 100018,
-            200 => 100019
-        ], //'贵州',
+        mtopcard\ChinaMobileCard => [
+            25	=> [
+                30  => 100012,
+                50  => 100013,
+                100 => 100014,
+                200 => 100015
+            ], //'云南',
+            24	=> [
+                30  => 100016,
+                50  => 100017,
+                100 => 100018,
+                200 => 100019
+            ], //'贵州',
+        ],
+        mtopcard\ChinaTelecomCard => [
+            9	=> [
+                30  => 100024,
+                50  => 100025,
+                100 => 100026,
+                200 => 100027
+            ], //'上海',
+            18	=> [
+                30  => 100024,
+                50  => 100025,
+                100 => 100026,
+                200 => 100027
+            ], //'湖南',
+        ]
     ];
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
     const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
     //key格式 卡类型-面值-regin_no
     const Price = [
+        //移动
         "4-30-24" => 28.23, "4-50-24" => 47.05, "4-100-24" => 94.1, "4-200-24" => 188.2,//贵州 24
         "4-30-25" => 28.23, "4-50-25" => 47.05, "4-100-25" => 94.1, "4-200-25" => 188.2,//云南 25
+
+        //电信
+        "6-30-9" => 28.23, "6-50-9" => 47.05, "6-100-9" => 94.1, "6-200-9" => 188.2,//上海 9
+        "6-30-18" => 28.23, "6-50-18" => 47.05, "6-100-18" => 94.1, "6-200-18" => 188.2,//湖南 18
     ];
 }