Browse Source

Merge branch 'rmaster' of 39.97.239.116:gyfl/xyzshop into rmaster

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

+ 45 - 17
data/config/win/refill.ini.php

@@ -197,64 +197,64 @@ $lingzh_phone = ['name' => 'lingzh', 'store_id' => 28,'qualitys' => '1,3,4,5,6',
             ['goods_id' => 6389, 'price' => 9.51, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
             ['goods_id' => 6389, 'price' => 9.53, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
             ['goods_id' => 6389, 'price' => 8.95, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.91, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6389, 'price' => 8.91, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6389, 'price' => 8.99, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
         ],
         20 => [
             ['goods_id' => 6390, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6390, 'price' => 19.02, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
             ['goods_id' => 6390, 'price' => 19.06, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
             ['goods_id' => 6390, 'price' => 17.9, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.82, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6390, 'price' => 17.82, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6390, 'price' => 17.98, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         30 => [
             ['goods_id' => 6391, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6391, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
             ['goods_id' => 6391, 'price' => 28.59, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
             ['goods_id' => 6391, 'price' => 26.85, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.73, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6391, 'price' => 26.73, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6391, 'price' => 26.97, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         50 => [
             ['goods_id' => 6392, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6392, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
             ['goods_id' => 6392, 'price' => 47.65, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
             ['goods_id' => 6392, 'price' => 44.75, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.55, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6392, 'price' => 44.55, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6392, 'price' => 44.95, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         100 => [
             ['goods_id' => 6393, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6393, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
             ['goods_id' => 6393, 'price' => 95.3, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
             ['goods_id' => 6393, 'price' => 89.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 891, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6393, 'price' => 891, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6393, 'price' => 89.9, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         200 => [
             ['goods_id' => 6394, 'price' => 190.60, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6394, 'price' => 190.20, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
             ['goods_id' => 6394, 'price' => 190.60, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
             ['goods_id' => 6394, 'price' => 179, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 178.2, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6394, 'price' => 178.2, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6394, 'price' => 179.8, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         300 => [
             ['goods_id' => 6395, 'price' => 285.90, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6395, 'price' => 285.30, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
             ['goods_id' => 6395, 'price' => 285.90, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
             ['goods_id' => 6395, 'price' => 268.5, 'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 267.3, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6395, 'price' => 267.3, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6395, 'price' => 269.7, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ],
         500 => [
             ['goods_id' => 6396, 'price' => 476.50, 'quality' => 1, 'card_type' => 'chinamobile'],
             ['goods_id' => 6396, 'price' => 475.50, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom'],
             ['goods_id' => 6396, 'price' => 476.50, 'quality' => 3, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
             ['goods_id' => 6396, 'price' => 447.5,  'quality' => 4, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 445.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
-            ['goods_id' => 6396, 'price' => 445.5, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
+            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 5, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+            ['goods_id' => 6396, 'price' => 449.5, 'quality' => 6, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']
         ]
     ],
     'official_sn' => true, 'refill_type' => 'api'];
@@ -1202,6 +1202,32 @@ $yuanmai_phone = ['name' => 'yuanmai', 'store_id' => 71, 'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$langke_phone = ['name' => 'langke', 'store_id' => 72, 'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 6700, 'price' => 9.75, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6701, 'price' => 19.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6702, 'price' => 29.25, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6703, 'price' => 48.75, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6704, 'price' => 97.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6705, 'price' => 195, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6706, 'price' => 292.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6707, 'price' => 487.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$yunlingds_phone = ['name' => 'yunlingds', 'store_id' => 73, 'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 6708, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6709, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6710, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6711, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6712, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6713, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6714, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6715, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -1248,7 +1274,9 @@ $phone_providers = [
     ['name' => 'fengyeman24', 'cfg' => $fengyeman24_phone],
     ['name' => 'moxj_yd', 'cfg' => $moxj_yd_phone],
     ['name' => 'xingzy', 'cfg' => $xingzy_phone],
-    ['name' => 'yuanmai', 'cfg' => $yuanmai_phone]
+    ['name' => 'yuanmai', 'cfg' => $yuanmai_phone],
+    ['name' => 'langke', 'cfg' => $langke_phone],
+    ['name' => 'yunlingds', 'cfg' => $yunlingds_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

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

@@ -1202,6 +1202,32 @@ $yuanmai_phone = ['name' => 'yuanmai', 'store_id' => 71, 'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$langke_phone = ['name' => 'langke', 'store_id' => 72, 'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 6700, 'price' => 9.75, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6701, 'price' => 19.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6702, 'price' => 29.25, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6703, 'price' => 48.75, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6704, 'price' => 97.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6705, 'price' => 195, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6706, 'price' => 292.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6707, 'price' => 487.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$yunlingds_phone = ['name' => 'yunlingds', 'store_id' => 73, 'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 6708, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6709, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6710, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6711, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6712, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6713, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6714, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6715, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -1248,7 +1274,9 @@ $phone_providers = [
     ['name' => 'fengyeman24', 'cfg' => $fengyeman24_phone],
     ['name' => 'moxj_yd', 'cfg' => $moxj_yd_phone],
     ['name' => 'xingzy', 'cfg' => $xingzy_phone],
-    ['name' => 'yuanmai', 'cfg' => $yuanmai_phone]
+    ['name' => 'yuanmai', 'cfg' => $yuanmai_phone],
+    ['name' => 'langke', 'cfg' => $langke_phone],
+    ['name' => 'yunlingds', 'cfg' => $yunlingds_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 29 - 1
data/config/xyzadm/refill.ini.php

@@ -1202,6 +1202,32 @@ $yuanmai_phone = ['name' => 'yuanmai', 'store_id' => 71, 'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$langke_phone = ['name' => 'langke', 'store_id' => 72, 'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 6700, 'price' => 9.75, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6701, 'price' => 19.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6702, 'price' => 29.25, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6703, 'price' => 48.75, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6704, 'price' => 97.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6705, 'price' => 195, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6706, 'price' => 292.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6707, 'price' => 487.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$yunlingds_phone = ['name' => 'yunlingds', 'store_id' => 73, 'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 6708, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6709, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6710, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6711, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6712, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6713, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6714, 'price' => 285.9, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6715, 'price' => 476.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -1248,7 +1274,9 @@ $phone_providers = [
     ['name' => 'fengyeman24', 'cfg' => $fengyeman24_phone],
     ['name' => 'moxj_yd', 'cfg' => $moxj_yd_phone],
     ['name' => 'xingzy', 'cfg' => $xingzy_phone],
-    ['name' => 'yuanmai', 'cfg' => $yuanmai_phone]
+    ['name' => 'yuanmai', 'cfg' => $yuanmai_phone],
+    ['name' => 'langke', 'cfg' => $langke_phone],
+    ['name' => 'yunlingds', 'cfg' => $yunlingds_phone]
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 79 - 0
helper/refill/api/xyz/langke/RefillCallBack.php

@@ -0,0 +1,79 @@
+<?php
+
+
+namespace refill\langke;
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['sign']);
+
+        $sign = $this->sign($input);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v)
+        {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1))
+            {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urldecode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urldecode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=" . config::KEY;
+        return md5($body);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['status']);
+        $order_sn = $params['onlystr'];
+
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === 2) {
+            $data['official_sn'] = strtolower($params['channelno']) == 'null' ? '' : $params['channelno'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        } elseif ($status === 3) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
+        }
+    }
+}

+ 108 - 0
helper/refill/api/xyz/langke/RefillPhone.php

@@ -0,0 +1,108 @@
+<?php
+
+
+namespace refill\langke;
+
+require_once(BASE_HELPER_RAPI_PATH . '/langke/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillOil
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(string $card_no,int $card_type,int $amount,array $other)
+    {
+        $params['channelsort'] = 'PHONE_BILL';
+        $params['cardtype'] = config::operator[$card_type];
+        $params['orgid'] = config::ORGID;
+        $params['amt'] = $amount;
+        $params['notifyurl'] = config::NOTIFY_URL;
+        $params['onlystr'] = $other['order_sn'];
+        $params['account'] = $card_no;
+        return $params;
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $content = '';
+        foreach ($params as $key => $val) {
+            if (false === $this->check_empty($val)) {
+                $content .= "{$key}={$val}&";
+            }
+        }
+        $content .= "key=" . config::KEY;
+
+        return md5($content);
+    }
+
+    public function add($card_no,$card_type,$amount,$input,&$net_errno = 0)
+    {
+        $params = $this->req_params($card_no,$card_type,$amount,$input);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL,$params,'POST',false, config::ExtHeaders, $net_errno);
+        if (empty($resp)) {
+            return [false,'系统错误',true];
+        }
+        else
+        {
+            Log::record($resp,Log::DEBUG);
+            $resp = json_decode($resp,true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['state'] == 0) {
+                return [true, $resp['data'], false];
+            } else {
+                return [false, $resp['msg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['orgid'] = config::ORGID;
+        $params['onlystr'] = $refill_info['order_sn'];
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_QUERY_URL,$params,'POST',false,config::ExtHeaders);
+        if (empty($resp)) {
+            return [false,'系统错误'];
+        }
+        else
+        {
+            Log::record($resp,Log::DEBUG);
+            $resp = json_decode($resp,true);
+            if (empty($resp)) {
+                return [false,'系统错误'];
+            }
+            elseif($resp['state'] == 0)
+            {
+                if ($resp['data']['status'] == 2) {
+                    $updata['official_sn'] = $resp['channelno'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($resp['data']['status'] == 3) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($resp['data']['status'] == 0) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['data']];
+                }
+                return [true, $order_state];
+            }
+            else {
+                return [false,$resp['msg']];
+            }
+        }
+    }
+
+}

+ 21 - 0
helper/refill/api/xyz/langke/config.php

@@ -0,0 +1,21 @@
+<?php
+
+
+namespace refill\langke;
+
+use mtopcard;
+class config
+{
+    //975 1
+    const ORDER_URL = 'http://120.25.107.85/order/createOrder.html';
+    const ORDER_QUERY_URL = 'http://120.25.107.85/order/queryOrderInfo.html';
+    const KEY = '0TKtWOgpaLc5CQ0KvewK5J';
+    const ORGID = 7532391600;
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_langke.php";
+    const ExtHeaders = ['Content-Type: application/x-www-form-urlencoded'];
+    const operator = [
+        mtopcard\ChinaMobileCard => 'YD',
+        mtopcard\ChinaUnicomCard => 'LT',
+        mtopcard\ChinaTelecomCard => 'DX'
+    ];
+}

BIN
helper/refill/api/xyz/langke/orderAPI.docx


+ 3 - 0
helper/refill/api/xyz/langke/账号.txt

@@ -0,0 +1,3 @@
+http://120.25.107.85/main.html
+18500608333
+椰子23456

BIN
helper/refill/api/xyz/yuanmai/~$元迈话费充值接口说明_v2.4.doc


+ 58 - 0
helper/refill/api/xyz/yunlingds/RefillCallBack.php

@@ -0,0 +1,58 @@
+<?php
+
+
+namespace refill\yunlingds;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yunlingds/config.php');
+
+
+use refill;
+use Log;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "userid={$userid}&orderid={$params['orderid']}&sporderid={$params['sporderid']}&merchantsubmittime={$params['merchantsubmittime']}";
+        $content .= "&resultno={$params['resultno']}&key={$key}";
+        return strtoupper(md5($content));
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['resultno']);
+        $order_sn = $params['sporderid'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if (empty($params['remark1'])) {
+            $data['official_sn'] = '';
+        } else {
+            $data['official_sn'] = strtolower($params['remark1']) == 'null' ? '' : $params['remark1'];
+        }
+
+        if ($status === 1) {
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true];
+        } elseif ($status === 9) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
+        }
+    }
+}

+ 113 - 0
helper/refill/api/xyz/yunlingds/RefillPhone.php

@@ -0,0 +1,113 @@
+<?php
+
+namespace refill\yunlingds;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yunlingds/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
+    {
+        $params['userid'] = config::USER_ID;
+        $params['productid'] = config::product_id[$card_type][$amount];
+        $params['price'] = $amount;
+        $params['num'] = 1;
+        $params['mobile'] = $phone;
+        $params['spordertime'] = date("YmdHis");
+        $params['sporderid'] = $order_sn;
+        $params['back_url'] = config::NOTIFY_URL;
+        $params['paytype'] = config::operator[$card_type];
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $card_type, $amount, $order_sn);
+        if(empty($params['productid'])) {
+            return [false, '商品编号获取失败', false];
+        }
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
+
+        if (empty($resp)) {
+            return [false, '网络错误', true];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            }
+            $resultno = intval($resp['resultno']);
+            if (in_array($resultno, [0,2])) {
+                return [true, $resp['orderid'], false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['sporderid'] = $refill_info['order_sn'];
+        $params['userid'] = config::USER_ID;
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp);
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+            $resultno = intval($resp['resultno']);
+            if ($resultno === 1) {
+                $order_state = ORDER_STATE_SUCCESS;
+                $updata['official_sn'] = $resp['remark1'];
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+            } elseif ($resultno === 9) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($resultno, [0,2])) {
+                $order_state = ORDER_STATE_SEND;
+            } else {
+                return [false, $resp['message']];
+            }
+            return [true, $order_state];
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "userid={$userid}&productid={$params['productid']}&price={$params['price']}&num={$params['num']}&mobile={$params['mobile']}&spordertime={$params['spordertime']}";
+        $content .= "&sporderid={$params['sporderid']}&key={$key}";
+        return md5($content);
+    }
+
+    public function xmlToArray($xml)
+    {
+        //禁止引用外部xml实体
+        libxml_disable_entity_loader(true);
+        $xmlstring = simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA);
+        $val = json_decode(json_encode($xmlstring), true);
+
+        return $val;
+    }
+}

+ 41 - 0
helper/refill/api/xyz/yunlingds/config.php

@@ -0,0 +1,41 @@
+<?php
+
+
+namespace refill\yunlingds;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://121.89.243.74:9086/onlinepay.do';
+    const QUERY_URL= 'http://121.89.243.74:9086/searchpay.do';
+    const USER_ID= '10002623';
+    const KEY = 'M4GZNKZCW6kasAMbpGxDn3AcPJiYDFS5';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yunlingds.php";
+
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+    const operator = [
+        mtopcard\ChinaMobileCard  => 'yd',
+        mtopcard\ChinaUnicomCard  => 'lt',
+        mtopcard\ChinaTelecomCard => 'dx'
+    ];
+    const product_id = [
+        mtopcard\ChinaMobileCard => [
+            30 => '30000000908',
+            50 => '30000000909',
+            100 => '30000000910',
+            200 => '30000000911'
+        ],
+        mtopcard\ChinaUnicomCard => [
+            30 => '30000000731',
+            50 => '30000000732',
+            100 => '30000000733',
+            200 => '30000000992'
+        ],
+        mtopcard\ChinaTelecomCard => [
+            30 => '30000000736',
+            50 => '30000000737',
+            100 => '30000000738',
+            200 => '30000000739'
+        ],
+    ];
+}

BIN
helper/refill/api/xyz/yunlingds/新系统代理充值接口 - 文档.doc


+ 13 - 0
helper/refill/api/xyz/yunlingds/新系统椰子电商代理信息.txt

@@ -0,0 +1,13 @@
+代理平台:
+代理登录地址:http://121.89.243.74:7080/login.jsp
+登录账号:yezids
+登录密码:
+
+
+
+接口使用:
+用户编号(userid):10002623
+秘钥(key):M4GZNKZCW6kasAMbpGxDn3AcPJiYDFS5
+余额查询地址:http://121.89.243.74:9086/searchbalance.do
+接口充值地址:http://121.89.243.74:9086/onlinepay.do
+主动查单地址:http://121.89.243.74:9086/searchpay.do

+ 6 - 0
mobile/callback/refill_langke.php

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

+ 4 - 0
mobile/callback/refill_yunlingds.php

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

+ 20 - 0
test/TestRefill.php

@@ -419,6 +419,26 @@ class TestRefill extends TestCase
         refill\RefillFactory::instance()->notify('yuanmai',$params);
     }
 
+    public function testLangkePhone()
+    {
+        $providers = new refill\langke\RefillPhone([]);
+//        $resp = $providers->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
+        $resp = $providers->query(['order_sn' => '29461624952660047520', 'ch_trade_no' => '210623174333941000']);
+        $data = '{"channelsort":"PHONE_BILL","channelno":"2021062922001123211428063487","onlystr":"29461624952660047520","channel":"TM","sign":"8aedceac4ce4d897f1f06977a9094371","amt":"50","notifyurl":"https:\/\/www.xyzshops.cn\/mobile\/signature.php","cardtype":"","cardno":"","orgid":"7532391600","account":"13699279618","status":"2"}';
+        $params = json_decode($data, true);
+//        refill\RefillFactory::instance()->notify('langke',$params);
+    }
+
+    public function testYunlingdsPhone()
+    {
+        $providers = new refill\yunlingds\RefillPhone([]);
+//        $resp = $providers->add(18074608795, 6, 30, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '85351624961920020593']);
+        $data = '{"orderid":"OWS21062918188862392","sporderid":"85351624961920020593","userid":"10002623","merchantsubmittime":"20210629181929","resultno":"1","parvalue":"30","remark1":"AW20210629181906yRAvM","payno":"AW20210629181906yRAvM","fundbalance":"-28.59","sign":"11369509ADCF2A2612B3531A15049BDD"}';
+        $params = json_decode($data, true);
+        refill\RefillFactory::instance()->notify('yunlingds',$params);
+    }
+
     public function testTongluPhone()
     {
         $providers = new refill\tonglu\RefillPhone([]);