Parcourir la source

Merge branch 'rch' into raccount

lowkeyman il y a 3 mois
Parent
commit
8fbcfc819e

+ 38 - 0
data/config/xyz/phone.ini.php

@@ -3832,6 +3832,43 @@ $youge_sec_phone = [
 //        ]
     ]
 ];
+$masheng_phone = [
+    'name' => 'masheng', 'store_id' => 428, 'qualitys' => '2', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 9369, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9369, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 9370, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9370, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+//            ['goods_id' => 9371, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9371, 'price' => 33.87, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+//            ['goods_id' => 9372, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9372, 'price' => 50.8, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 9373, 'price' => 101.6, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9373, 'price' => 101.6, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 9374, 'price' => 203.2, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9374, 'price' => 203.2, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+            ['goods_id' => 9375, 'price' => 304.8, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9375, 'price' => 304.8, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ],
+        500 => [
+            ['goods_id' => 9376, 'price' => 508, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9376, 'price' => 508, 'quality' => 2, 'card_type' => 'chinatelecom']
+        ]
+    ]
+];
 
 $phone_providers = [
 	[ 'name' => 'xunyin', 'cfg' => $xunyin_phone ],
@@ -3947,4 +3984,5 @@ $phone_providers = [
     [ 'name' => 'qingyu', 'cfg' => $qingyu_phone ],
     [ 'name' => 'yifutong', 'cfg' => $yifutong_phone ],
     [ 'name' => 'youge_sec', 'cfg' => $youge_sec_phone ],
+//    [ 'name' => 'masheng', 'cfg' => $masheng_phone ],
 	];

+ 46 - 0
data/config/yl/phone.ini.php

@@ -2194,6 +2194,51 @@ $yeyankc002_phone = [
 //        ]
     ]
 ];
+$tengsu_phone = [
+    'name' => 'tengsu', 'store_id' => 346, 'qualitys' => '1', 'official_sn' => true, 'refill_type' => 'api',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8777, 'price' => 10, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8777, 'price' => 10, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8777, 'price' => 10, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8778, 'price' => 20, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8778, 'price' => 20, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8778, 'price' => 20, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        30 => [
+//            ['goods_id' => 8779, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8779, 'price' => 28.26, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8779, 'price' => 30, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 8780, 'price' => 48.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8780, 'price' => 47.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8780, 'price' => 50, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8781, 'price' => 96.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8781, 'price' => 94.2, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8781, 'price' => 97, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8782, 'price' => 193.2, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 8782, 'price' => 188.4, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8782, 'price' => 194, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        300 => [
+//            ['goods_id' => 8783, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8783, 'price' => 300, 'quality' => 1, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 8783, 'price' => 291, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        500 => [
+//            ['goods_id' => 8784, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8784, 'price' => 500, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8784, 'price' => 500, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ]
+];
 
 
 $phone_providers = [
@@ -2268,4 +2313,5 @@ $phone_providers = [
     [ 'name' => 'lihui', 'cfg' => $lihui_phone ],
     [ 'name' => 'yeyankc001', 'cfg' => $yeyankc001_phone ],
     [ 'name' => 'yeyankc002', 'cfg' => $yeyankc002_phone ],
+    [ 'name' => 'tengsu', 'cfg' => $tengsu_phone ],
 	];

+ 36 - 0
helper/refill/api/xyz/masheng/API.MD

@@ -0,0 +1,36 @@
+
+## 玛昇快充
+
+### 账号:
+> http://admin.mashengquanyi.com/telequity
+- 登陆账号:4637888
+- 登陆密码:123456
+- 商户号:4637888
+- KEY:K0DYDKRH05KYBWI4846Z9VRR
+
+### 对接:
+- api接口文档地址:
+  > http://api.mashengquanyi.com
+- 话费下单地址:
+  > http://api.mashengquanyi.com/api/addOrder
+- 订单主动查询地址:
+  > http://api.mashengquanyi.com/api/payment/order
+- 余额查询:
+  > http://api.mashengquanyi.com/api/payment/query/bank
+
+### 店铺
+- 账号:masheng
+- 密码:masheng67890
+
+### 编码
+100YDJS	中国移动100-秒到
+200YDJS	移动200-秒到
+300YDJS	移动300-秒到
+500YDJS	移动500-秒到
+
+30DXJS	电信30-秒到
+50DXJS	电信50-秒到
+100DXJS	中国电信100-秒到
+200DXJS	电信200-秒到
+300DXJS	电信300-秒到
+500DXJS	电信500-秒到

+ 51 - 0
helper/refill/api/xyz/masheng/RefillCallBack.php

@@ -0,0 +1,51 @@
+<?php
+namespace refill\masheng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/masheng/config.php');
+
+use refill;
+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): string
+    {
+        $userid = config::USER_ID;
+        $key = config::KEY;
+        $content = "agent_id=$userid&amount={$params['amount']}&batch_no={$params['batch_no']}&key=$key&order_id={$params['order_id']}&pay_at={$params['pay_at']}&status={$params['status']}";
+        return md5($content);
+    }
+
+    public function notify($params): array
+    {
+        $status = intval($params['status']);
+        $order_sn = $params['batch_no'];
+        $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) {
+            $official_sn = $params['refid '];
+
+            $data['official_sn'] = $official_sn;
+            $data['ch_trade_no'] = $params['order_id'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        } elseif ($status === 4) {
+            Model('refill_order')->edit($order_id, ['ch_trade_no' => $params['order_id']]);
+            return [$order_id, false, true, true, ''];
+        } else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 144 - 0
helper/refill/api/xyz/masheng/RefillPhone.php

@@ -0,0 +1,144 @@
+<?php
+
+namespace refill\masheng;
+
+require_once(BASE_HELPER_RAPI_PATH . '/masheng/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, $card_type, string $order_sn): array
+    {
+        $productid = config::ProductIdS[$card_type][$amount] ?? false;
+        if ($productid === false){
+            return [];
+        }
+
+        $params['batch_no'] = $order_sn;
+        $params['agent_id'] = config::USER_ID;
+        $params['productNo'] = $productid;
+        $params['account'] = $phone;
+        $params['notify_url'] = config::NOTIFY_URL;
+        $params['add_at'] = date("Y-m-d H:i:s");
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0): array
+    {
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
+        if (empty($params)) {
+            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 = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误', true];
+            } elseif ($resp['code'] === 200) {
+                return [true, '', false];
+            } else {
+                return [false, $resp['message'], false];
+            }
+        }
+    }
+
+    public function query($refill_info): array
+    {
+        $params['agent_id'] = config::USER_ID;
+        $params['batch_no'] = $refill_info['order_sn'];
+        $key = config::KEY;
+        $content = "agent_id={$params['agent_id']}&batch_no={$params['batch_no']}&key=$key";
+        $params['sign'] = md5($content);
+
+        $resp = http_request(config::QUERY_URL, $params);
+
+        if (empty($resp)) {
+            return [false, '网络错误', ''];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误', ''];
+            }
+            elseif ($resp['code'] === 200 && !empty($resp['result']))
+            {
+                $official_sn = '';
+
+                $status = intval($resp['result']['status']);
+                if ($status === 1) {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === 2) {
+                    $official_sn = $resp['result']['refid']; //TODO 临时代码,等上游更新文档后进行调整
+
+                    $updata['official_sn'] = $official_sn;
+                    $updata['ch_trade_no'] = $resp['result']['order_id'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === 4) {
+                    Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $resp['result']['order_id']]);
+                    $order_state = ORDER_STATE_CANCEL;
+                } else {
+                    return [false, $resp['message'], ''];
+                }
+
+                return [true, $order_state, $official_sn];
+            }
+            else {
+                return [false, $resp['message'], ''];
+            }
+        }
+    }
+
+    public function balance(): array
+    {
+        $params['agent_id'] = config::USER_ID;
+        $key = config::KEY;
+        $content = "agent_id={$params['agent_id']}&key=$key";
+        $params['sign'] = md5($content);
+
+        $resp = http_request(config::BALANCE_URL, $params);
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp)) {
+                return [false, '系统错误'];
+            } elseif ($resp['code'] === 200) {
+                return [true, $resp['result']['recharge_amount']];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    private function sign($params): string
+    {
+        $key = config::KEY;
+        $content = "account={$params['account']}&add_at={$params['add_at']}&agent_id={$params['agent_id']}&batch_no={$params['batch_no']}";
+        $content .= "&key=$key&notify_url={$params['notify_url']}&productNo={$params['productNo']}";
+        return md5($content);
+    }
+}

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

@@ -0,0 +1,41 @@
+<?php
+
+
+namespace refill\masheng;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://api.mashengquanyi.com/api/addOrder';
+    const QUERY_URL= 'http://api.mashengquanyi.com/api/payment/order';
+    const BALANCE_URL = 'http://api.mashengquanyi.com/api/payment/query/bank';
+
+    const USER_ID= '4637888';
+    const KEY = 'K0DYDKRH05KYBWI4846Z9VRR';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_masheng.php";
+
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;'];
+
+    const ProductIdS = [
+        mtopcard\ChinaMobileCard =>
+            [
+                100 => '100YDJS',
+                200 => '200YDJS',
+                300 => '300YDJS',
+                500 => '500YDJS',
+            ],
+        mtopcard\ChinaUnicomCard =>
+            [
+
+            ],
+        mtopcard\ChinaTelecomCard =>
+            [
+                30 => '30DXJS',
+                50 => '50DXJS',
+                100 => '100DXJS',
+                200 => '200DXJS',
+                300 => '300DXJS',
+                500 => '500DXJS',
+            ]
+    ];
+}

+ 33 - 0
helper/refill/api/yl/tengsu/API.MD

@@ -0,0 +1,33 @@
+## 腾速全国1号
+
+### 正式环境:
+- 话费下单地址:http://121.43.172.242:16188/plat/api/hf/submitorder
+- 查询地址:http://121.43.172.242:16188/plat/api/queryorder
+- 查询余额地址:http://121.43.172.242:16188/plat/api/querybalance
+
+- 客户端地址:http://121.43.172.242:16188/plat/login
+- 账号:FQS999
+- 密码:123456
+- 客户ID:100033
+- 密钥:9d52bec94e45417b924ba2689064d8f3
+
+### 对接文档地址:
+> https://docs.qq.com/doc/DWkV1VkxQVk13eEtQ
+
+### 店铺账号
+- tengsu
+- tengsu67890
+
+### 产品编码
+全国移动50元 1000050
+全国移动100元 1000100
+全国移动200元 1000200
+
+全国联通200元 2000200
+全国联通100元 2000100
+全国联通50元 2000050
+全国联通30元 2000030
+
+全国电信300元 3000300
+全国电信200元 3000200
+全国电信100元 3000100

+ 52 - 0
helper/refill/api/yl/tengsu/RefillCallBack.php

@@ -0,0 +1,52 @@
+<?php
+namespace refill\tengsu;
+
+require_once(BASE_HELPER_RAPI_PATH . '/tengsu/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) {
+            $official_sn = strtolower($params['szRtnMsg']) == 'null' ? '' : $params['szRtnMsg'];
+
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, true, true, ''];
+        }
+        else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 146 - 0
helper/refill/api/yl/tengsu/RefillPhone.php

@@ -0,0 +1,146 @@
+<?php
+
+namespace refill\tengsu;
+
+require_once(BASE_HELPER_RAPI_PATH . '/tengsu/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, '网络错误', ''];
+            }
+
+            $official_sn = '';
+
+            $status = $resp['nRtn'];
+            if ($status === 5012) {
+                $official_sn = $resp['szRtnMsg'];
+
+                $updata['official_sn'] = $official_sn;
+                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, $official_sn];
+        }
+    }
+
+    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);
+    }
+}

+ 46 - 0
helper/refill/api/yl/tengsu/config.php

@@ -0,0 +1,46 @@
+<?php
+
+
+namespace refill\tengsu;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://121.43.172.242:16188/plat/api/hf/submitorder';
+    const QUERY_URL= 'http://121.43.172.242:16188/plat/api/queryorder';
+    const BALANCE_URL = 'http://121.43.172.242:16188/plat/api/querybalance';
+
+    const USER_ID= '100033';
+    const KEY = '9d52bec94e45417b924ba2689064d8f3';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_tengsu.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 => [
+            30  => 2000030,
+            50  => 2000050,
+            100 => 2000100,
+            200 => 2000200,
+        ],
+        mtopcard\ChinaTelecomCard => [
+            100 => 3000100,
+            200 => 3000200,
+            300 => 3000300,
+        ],
+    ];
+}

+ 7 - 0
mobile/callback/refill_masheng.php

@@ -0,0 +1,7 @@
+<?php
+
+$content = $_SERVER['post_content'];
+$inputs = json_decode($content,true);
+refill\util::push_notify('masheng',$inputs);
+
+echo ('success');

+ 4 - 0
mobile/callback/refill_tengsu.php

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

+ 19 - 0
test/TestRefill.php

@@ -6346,6 +6346,19 @@ class TestRefill extends TestCase
         $resp = $provider->balance();
     }
 
+    public function testmasheng()
+    {
+        $provider = $this->getProvider('masheng');
+        $resp = $provider->balance();
+//
+//        $query_params = [
+//            'order_sn' => $this->make_sn(),
+//        ];
+//        $provider->query($query_params);
+
+//        $net_errno = '';
+//        $provider->add('13911129867',4, 1, ['order_sn' => $this->make_sn()], $net_errno);
+    }
     public function testsign()
     {
         $sign = function($params)
@@ -6369,6 +6382,12 @@ class TestRefill extends TestCase
 //            'sign' => '99469ee5770c27f8a849f2cf2c652e25'
         ]);
     }
+
+    public function testtengsu()
+    {
+        $provider = $this->getProvider('tengsu');
+        $resp = $provider->balance();
+    }
 }