Parcourir la source

add channel,kainuo_15m,kainuo_60m

zhaoming il y a 1 an
Parent
commit
e55efddfa8

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

@@ -9695,6 +9695,97 @@ $yezifensheng_phone = ['name' => 'yezifensheng', 'store_id' => 370, 'qualitys' =
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$kainuo_15m_phone = ['name' => 'kainuo_15m', 'store_id' => 371, 'qualitys' => '3',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8918, 'price' => 9.95, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8918, 'price' => 9.95, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8918, 'price' => 9.95, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8919, 'price' => 19.9, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8919, 'price' => 19.9, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8919, 'price' => 19.9, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 8920, 'price' => 29.85, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8920, 'price' => 29.85, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8920, 'price' => 29.85, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 8921, 'price' => 49.75, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8921, 'price' => 49.75, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8921, 'price' => 49.75, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8922, 'price' => 99.5, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8922, 'price' => 99.5, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8922, 'price' => 99.5, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8923, 'price' => 199, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8923, 'price' => 199, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8923, 'price' => 199, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8924, 'price' => 298.5, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8924, 'price' => 298.5, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8924, 'price' => 298.5, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8925, 'price' => 497.5, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8925, 'price' => 497.5, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8925, 'price' => 497.5, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+
+$kainuo_60m_phone = ['name' => 'kainuo_60m', 'store_id' => 372, 'qualitys' => '3',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8926, 'price' => 9.95, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8926, 'price' => 9.95, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8926, 'price' => 9.95, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8927, 'price' => 19.9, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8927, 'price' => 19.9, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8927, 'price' => 19.9, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 8928, 'price' => 29.85, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8928, 'price' => 29.85, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8928, 'price' => 29.85, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 8929, 'price' => 49.75, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8929, 'price' => 49.75, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8929, 'price' => 49.75, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8930, 'price' => 99.5, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8930, 'price' => 99.5, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8930, 'price' => 99.5, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8931, 'price' => 199, 'quality' => 3, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8931, 'price' => 199, 'quality' => 3, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8931, 'price' => 199, 'quality' => 3, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8932, 'price' => 298.5, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8932, 'price' => 298.5, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8932, 'price' => 298.5, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8933, 'price' => 497.5, 'quality' => 3, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8933, 'price' => 497.5, 'quality' => 3, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8933, 'price' => 497.5, 'quality' => 3, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_p hone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -9988,6 +10079,8 @@ $phone_providers = [
     ['name' => 'xunyuan', 'cfg' => $xunyuan_phone],
     ['name' => 'nanjingpushang_hf', 'cfg' => $nanjingpushang_hf_phone],
     ['name' => 'yezifensheng', 'cfg' => $yezifensheng_phone],
+    ['name' => 'kainuo_15m', 'cfg' => $kainuo_15m_phone],
+    ['name' => 'kainuo_60m', 'cfg' => $kainuo_60m_phone],
 ];
 $config['phone_providers'] = $phone_providers;
 

+ 50 - 0
helper/refill/api/xyz/kainuo_15m/RefillCallBack.php

@@ -0,0 +1,50 @@
+<?php
+namespace refill\kainuo_15m;
+
+require_once(BASE_HELPER_RAPI_PATH . '/kainuo_15m/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
+        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
+        return md5($content);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['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['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+            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];
+        }
+    }
+}

+ 142 - 0
helper/refill/api/xyz/kainuo_15m/RefillPhone.php

@@ -0,0 +1,142 @@
+<?php
+
+namespace refill\kainuo_15m;
+
+require_once(BASE_HELPER_RAPI_PATH . '/kainuo_15m/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 $amount, int $card_type, string $order_sn)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['szProductId'] = config::Product[$card_type][$amount];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
+        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, $amount, $card_type, $order_sn);
+
+        $sign = $this->sign($params);
+        $params['szVerifyString'] = $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);
+
+            $nRtn = $resp['nRtn'];
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999], true)) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::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, '网络错误'];
+            }
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $updata['official_sn'] = $resp['szRtnMsg'];
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg']];
+            }
+
+            return [true, $order_state];
+        }
+    }
+
+    public function balance()
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::BALANCE_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['nRtn'] === 0) {
+                return [true, $resp['fBalance']];
+            } else {
+                return [false, $resp['szRtnCode']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
+        return md5($content);
+    }
+}

+ 32 - 0
helper/refill/api/xyz/kainuo_15m/api.txt

@@ -0,0 +1,32 @@
+正式环境:
+话费提交地址:http://121.40.244.114:10186/plat/api/old/submitorder
+查询地址:http://121.40.244.114:10186/plat/api/old/queryorder
+查询余额地址:http://121.40.244.114:10186/plat/api/old/queryBalance
+
+对接文档地址:https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ
+
+客户端地址:http://121.40.244.114:10186/plat/index
+
+
+账户信息
+
+账号: yl15min
+密码:123456bjyl
+
+ID:  200064
+密钥:d43e670448374bbc94f867e940272d71
+
+
+
+
+全国移动50元	1000050
+全国移动100元	1000100
+全国移动200元	1000200
+
+全国联通50元	2000050
+全国联通100元	2000100
+全国联通200元	2000200
+
+全国电信50元	3000050
+全国电信100元	3000100
+全国电信200元	3000200

+ 45 - 0
helper/refill/api/xyz/kainuo_15m/config.php

@@ -0,0 +1,45 @@
+<?php
+
+
+namespace refill\kainuo_15m;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://121.40.244.114:10186/plat/api/old/submitorder';
+    const QUERY_URL= 'http://121.40.244.114:10186/plat/api/old/queryorder';
+    const BALANCE_URL = 'http://121.40.244.114:10186/plat/api/old/queryBalance';
+
+    const USER_ID= '200064';
+    const KEY = 'd43e670448374bbc94f867e940272d71';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_kainuo_15m.php";
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NOS = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
+
+    const Product = [
+        mtopcard\ChinaMobileCard => [
+            50  => 1000050,
+            100 => 1000100,
+            200 => 1000200,
+        ],
+        mtopcard\ChinaUnicomCard => [
+            50  => 2000050,
+            100 => 2000100,
+            200 => 2000200,
+        ],
+        mtopcard\ChinaTelecomCard => [
+            50  => 3000050,
+            100 => 3000100,
+            200 => 3000200,
+        ],
+    ];
+}

+ 50 - 0
helper/refill/api/xyz/kainuo_60m/RefillCallBack.php

@@ -0,0 +1,50 @@
+<?php
+namespace refill\kainuo_60m;
+
+require_once(BASE_HELPER_RAPI_PATH . '/kainuo_60m/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $sign = $this->sign($params);
+        if ($params['szVerifyString'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nDemo={$params['nDemo']}&fSalePrice={$params['fSalePrice']}";
+        $content .= "&nFlag={$params['nFlag']}&szKey={$key}";
+        return md5($content);
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['nFlag']);
+        $order_sn = $params['szOrderId'];
+        $order_info = Model('vr_order')->getOrderInfoForNotify(['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['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+            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];
+        }
+    }
+}

+ 142 - 0
helper/refill/api/xyz/kainuo_60m/RefillPhone.php

@@ -0,0 +1,142 @@
+<?php
+
+namespace refill\kainuo_60m;
+
+require_once(BASE_HELPER_RAPI_PATH . '/kainuo_60m/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 $amount, int $card_type, string $order_sn)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $order_sn;
+        $params['szPhoneNum'] = $phone;
+        $params['nMoney'] = $amount;
+        $params['nSortType'] = config::operator[$card_type];
+        $params['szProductId'] = config::Product[$card_type][$amount];
+        $params['nProductClass'] = 1;
+        $params['nProductType'] = 1;
+        $params['szTimeStamp'] = date("Y-m-d H:i:s");
+        $params['szNotifyUrl'] = config::NOTIFY_URL;
+        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, $amount, $card_type, $order_sn);
+
+        $sign = $this->sign($params);
+        $params['szVerifyString'] = $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);
+
+            $nRtn = $resp['nRtn'];
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($nRtn === 0) {
+                return [true, '', false];
+            } elseif (in_array($nRtn, config::ERR_NOS, true)) {
+                return [false, $resp['szRtnCode'], false];
+            } elseif (in_array($nRtn, [2050, 999], true)) {
+                $net_errno = "HTTP-{$nRtn}";
+                return [false, $resp['szRtnCode'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['szRtnCode'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $params['szOrderId'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szOrderId={$params['szOrderId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::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, '网络错误'];
+            }
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $updata['official_sn'] = $resp['szRtnMsg'];
+                Model('refill_order')->edit($refill_info['order_id'], $updata);
+                $order_state = ORDER_STATE_SUCCESS;
+            } elseif ($status === 5013) {
+                $order_state = ORDER_STATE_CANCEL;
+            } elseif (in_array($status, [5011,5019],true)) {
+                $order_state = ORDER_STATE_SEND;
+            } elseif ($status === 5005 && (time() - $refill_info['commit_time'] >= 300)) {
+                $order_state = ORDER_STATE_NOEXIST;
+            } else {
+                return [false, $resp['szRtnMsg']];
+            }
+
+            return [true, $order_state];
+        }
+    }
+
+    public function balance()
+    {
+        $params['szAgentId'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$params['szAgentId']}&szKey={$key}";
+        $params['szVerifyString'] = md5($content);
+
+        $resp = http_request(config::BALANCE_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['nRtn'] === 0) {
+                return [true, $resp['fBalance']];
+            } else {
+                return [false, $resp['szRtnCode']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "szAgentId={$userid}&szOrderId={$params['szOrderId']}&szPhoneNum={$params['szPhoneNum']}&nMoney={$params['nMoney']}&nSortType={$params['nSortType']}";
+        $content .= "&nProductClass={$params['nProductClass']}&nProductType={$params['nProductType']}&szTimeStamp={$params['szTimeStamp']}&szKey={$key}";
+        return md5($content);
+    }
+}

+ 32 - 0
helper/refill/api/xyz/kainuo_60m/api.txt

@@ -0,0 +1,32 @@
+正式环境:
+话费提交地址:http://121.40.244.114:10186/plat/api/old/submitorder
+查询地址:http://121.40.244.114:10186/plat/api/old/queryorder
+查询余额地址:http://121.40.244.114:10186/plat/api/old/queryBalance
+
+对接文档地址:https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ
+
+客户端地址:http://121.40.244.114:10186/plat/index
+
+
+账户信息
+
+账号: yl60min
+密码:123456bjyl
+
+ID:  200065
+密钥:5a4464d6f7144128a767745c46dbd806
+
+
+
+
+全国移动50元	1000050
+全国移动100元	1000100
+全国移动200元	1000200
+
+全国联通50元	2000050
+全国联通100元	2000100
+全国联通200元	2000200
+
+全国电信50元	3000050
+全国电信100元	3000100
+全国电信200元	3000200

+ 45 - 0
helper/refill/api/xyz/kainuo_60m/config.php

@@ -0,0 +1,45 @@
+<?php
+
+
+namespace refill\kainuo_60m;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://121.40.244.114:10186/plat/api/old/submitorder';
+    const QUERY_URL= 'http://121.40.244.114:10186/plat/api/old/queryorder';
+    const BALANCE_URL = 'http://121.40.244.114:10186/plat/api/old/queryBalance';
+
+    const USER_ID= '200065';
+    const KEY = '5a4464d6f7144128a767745c46dbd806';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_kainuo_60m.php";
+
+    const operator = [
+        mtopcard\ChinaMobileCard  => 1,
+        mtopcard\ChinaUnicomCard  => 2,
+        mtopcard\ChinaTelecomCard => 3
+    ];
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NOS = [
+        1000,1001,1003,1004,2001,2002,2003,2020,2021,1006,2030,3003
+    ];
+
+    const Product = [
+        mtopcard\ChinaMobileCard => [
+            50  => 1000050,
+            100 => 1000100,
+            200 => 1000200,
+        ],
+        mtopcard\ChinaUnicomCard => [
+            50  => 2000050,
+            100 => 2000100,
+            200 => 2000200,
+        ],
+        mtopcard\ChinaTelecomCard => [
+            50  => 3000050,
+            100 => 3000100,
+            200 => 3000200,
+        ],
+    ];
+}

+ 4 - 0
mobile/callback/refill_kainuo_15m.php

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

+ 4 - 0
mobile/callback/refill_kainuo_60m.php

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

+ 8 - 0
test/TestRefill.php

@@ -5635,6 +5635,14 @@ class TestRefill extends TestCase
         $provider = $this->getProvider('yixun_hf');
         [$succ, $val] = $provider->query(['order_sn'=>'53971695273960799345']);
     }
+
+    public function testKainuo15()
+    {
+        $provider = $this->getProvider('kainuo_15m');
+        $resp = $provider->balance();
+//        $resp = $provider->add(18074608795, 6, 50, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
+//        $resp = $provider->query(['order_sn' => '65391689824562951763']);
+    }
 }