Bladeren bron

meihan_fs

xiaoyu 2 jaren geleden
bovenliggende
commit
95fd59504d

+ 67 - 0
helper/refill/api/xyz/meihan_fs/RefillCallBack.php

@@ -0,0 +1,67 @@
+<?php
+namespace refill\meihan_fs;
+
+require_once(BASE_HELPER_RAPI_PATH . '/meihan_fs/config.php');
+
+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 sign($params)
+    {
+        $params['appSecret'] = config::APP_SECRET;
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            if($this->check_empty($value) === false) {
+                $content .= "{$key}={$value}&";
+            }
+        }
+        $content = rtrim($content, '&');
+        return md5($content);
+    }
+
+    private function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['orderStatus']);
+        $order_sn = $params['outOrderId'];
+        $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['ext1']) == 'null' ? '' : $params['ext1'];
+            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];
+        }
+    }
+}

+ 173 - 0
helper/refill/api/xyz/meihan_fs/RefillPhone.php

@@ -0,0 +1,173 @@
+<?php
+
+namespace refill\meihan_fs;
+
+require_once(BASE_HELPER_RAPI_PATH . '/meihan_fs/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    public function goods($quality,int $amount,int $card_type,$regin_no,$other)
+    {
+        [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$regin_no,$other);
+        if($goods_id <= 0) return [0,0];
+        $key = "{$card_type}-{$amount}-{$regin_no}";
+        $price = config::Price[$key];
+        if(empty($price)) {
+            Log::record("channel cannot find price where name={$this->mName}, goods_id = {$goods_id} card_type={$card_type} amount={$amount} regin_no={$regin_no}",Log::ERR);
+            return [0,0];
+        } else {
+            return [$goods_id,ncPriceFormat($price)];
+        }
+    }
+
+    private function req_params(int $phone, int $amount, int $card_type, string $order_sn, $regin_no)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['outOrderId'] = $order_sn;
+        $params['uuid'] = $phone;
+        $params['itemId'] = config::PRODUCT[$card_type][$regin_no][$amount];
+        $params['itemFace'] = $amount;
+        $params['callbackUrl'] = config::NOTIFY_URL;
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $regin_no = $params['regin_no'] ?? -1;
+        if($regin_no <= 0) {
+            return [false, '省份获取错误', false];
+        }
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn, $regin_no);
+        if(empty($params['itemId'])) {
+            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'] === '00') {
+                return [true, $resp['orderId'], false];
+            } elseif (in_array($resp['code'], config::ERRCODES, true)) {
+                return [false, $resp['msg'], false];
+            } elseif (in_array($resp['code'], ['-22', '-23', '-99'], true)) {
+                $net_errno = "HTTP-{$resp['code']}";
+                return [false, $resp['msg'], true];
+            } else {
+                $net_errno = "HTTP-998";
+                return [false, $resp['msg'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['outOrderId'] = $refill_info['order_sn'];
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        $params['sign'] = $this->sign($params);
+
+        $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, '网络错误'];
+            }
+            elseif ($resp['code'] === '00')
+            {
+                $status = $resp['orderStatus'];
+                if ($status === '2') {
+                    $updata['official_sn'] = $resp['ext1'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === '3') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === '1') {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === '4' && (time() - $refill_info['commit_time'] >= 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $resp['msg']];
+                }
+                return [true, $order_state];
+            }
+            else
+            {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['appId'] = config::APP_ID;
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        $params['sign'] = $this->sign($params);
+
+        $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['code'] === '00') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    /**
+     * 获取毫秒级别的时间戳
+     */
+    private function get_millisecond()
+    {
+        list($usec, $sec) = explode(" ", microtime());
+        return round($usec*1000);
+    }
+
+    private function sign($params)
+    {
+        $params['appSecret'] = config::APP_SECRET;
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            if($this->check_empty($value) === false) {
+                $content .= "{$key}={$value}&";
+            }
+        }
+        $content = rtrim($content, '&');
+        return md5($content);
+    }
+}

+ 137 - 0
helper/refill/api/xyz/meihan_fs/config.php

@@ -0,0 +1,137 @@
+<?php
+
+
+namespace refill\meihan_fs;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://47.106.88.10:8911/api/hf/order/submit';
+    const QUERY_URL = 'http://47.106.88.10:8911/api/order/query';
+    const BALANCE_URL = 'http://47.106.88.10:8911/api/account/balance';
+
+    const APP_ID = 'WtCDoePp9g';
+    const APP_SECRET = 'EQDmGGUwJLkjWFIE';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_meihan_fs.php";
+
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+    const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
+
+    const PRODUCT = [
+        mtopcard\ChinaMobileCard => [
+            //江苏
+            10 => [
+                30  => 100173,
+                50  => 100174,
+                100 => 100175,
+                200 => 100176,
+            ],
+            //贵州
+            24 => [
+                30  => 100177,
+                50  => 100178,
+                100 => 100179,
+                200 => 100180,
+            ],
+            //福建
+            13 => [
+                30  => 100181,
+                50  => 100182,
+                100 => 100183,
+                200 => 100184,
+            ],
+            //云南
+            25 => [
+                30  => 100189,
+                50  => 100190,
+                100 => 100191,
+                200 => 100192,
+            ],
+            //广西
+            20 => [
+                30  => 100193,
+                50  => 100194,
+                100 => 100195,
+                200 => 100196,
+            ],
+            //江西
+            14 => [
+                50  => 100337,
+                100 => 100338,
+                200 => 100339,
+            ],
+        ],
+
+        mtopcard\ChinaTelecomCard => [
+            //福建
+            13 => [
+                30  => 100201,
+                50  => 100202,
+                100 => 100203,
+                200 => 100204,
+            ],
+            //湖南
+            18 => [
+                30  => 100248,
+                50  => 100249,
+                100 => 100250,
+                200 => 100251,
+            ],
+            //四川
+            23 => [
+                30  => 100197,
+                50  => 100198,
+                100 => 100199,
+                200 => 100200,
+            ],
+            //广东
+            19 => [
+                30  => 100220,
+                50  => 100221,
+                100 => 100222,
+                200 => 100223,
+            ],
+            //江苏
+            10 => [
+                30  => 100209,
+                50  => 100210,
+                100 => 100211,
+                200 => 100212,
+            ],
+            //新疆
+            31 => [
+                30  => 100258,
+                50  => 100259,
+                100 => 100260,
+                200 => 100261,
+            ],
+            //海南
+            21 => [
+                30  => 100265,
+                50  => 100266,
+                100 => 100267,
+                200 => 100268,
+            ],
+        ],
+    ];
+
+    //key格式 卡类型-面值-regin_no
+    const Price = [
+        //移动
+        "4-30-10" => 28.35, "4-50-10" => 47.25, "4-100-10" => 94.5, "4-200-10" => 189,//江苏 10
+        "4-30-24" => 27.6, "4-50-24" => 46, "4-100-24" => 92, "4-200-24" => 184,//贵州 24
+        "4-30-13" => 28.05, "4-50-13" => 46.75, "4-100-13" => 93.5, "4-200-13" => 187,//福建 13
+        "4-30-25" => 27.9, "4-50-25" => 46.5, "4-100-25" => 93, "4-200-25" => 186,//云南 25
+        "4-30-20" => 28.05, "4-50-20" => 46.75, "4-100-20" => 93.5, "4-200-20" => 187,//广西 20
+        "4-50-14" => 46.75, "4-100-14" => 93.5, "4-200-14" => 187,//江西 14
+
+        //电信
+        "6-30-13" => 27.75, "6-50-13" => 46.25, "6-100-13" => 92.5, "6-200-13" => 185,//福建 13
+        "6-30-18" => 28.05, "6-50-18" => 46.75, "6-100-18" => 93.5, "6-200-18" => 187,//湖南 18
+        "6-30-23" => 27.75, "6-50-23" => 46.25, "6-100-23" => 92.5, "6-200-23" => 185,//四川 23
+        "6-30-19" => 28.2, "6-50-19" => 47, "6-100-19" => 94, "6-200-19" => 188,//广东 19
+        "6-30-10" => 28.05, "6-50-10" => 46.75, "6-100-10" => 93.5, "6-200-10" => 187,//江苏 10
+        "6-30-31" => 27.75, "6-50-31" => 46.25, "6-100-31" => 92.5, "6-200-31" => 185,//新疆 31
+        "6-30-21" => 27.75, "6-50-21" => 46.25, "6-100-21" => 92.5, "6-200-21" => 185,//海南 21
+    ];
+}

+ 81 - 0
helper/refill/api/xyz/meihan_fs/商品编码.txt

@@ -0,0 +1,81 @@
+江苏移动分省(暂时配置945,目前不正常)
+30:100173
+50:100174
+100:100175
+200:100176
+
+贵州移动分省    折扣92
+30:100177
+50:100178
+100:100179
+200:100180
+
+福建移动分省   折扣935
+30:100181
+50:100182
+100:100183
+200:100184
+
+云南移动分省    折扣93
+30:100189
+50:100190
+100:100191
+200:100192
+
+广西移动分省    折扣935
+30:100193
+50:100194
+100:100195
+200:100196
+
+江西移动分省    折扣935
+50:100337
+100:100338
+200:100339
+
+
+
+
+
+
+福建电信分省   折扣925
+30:100201
+50:100202
+100:100203
+200:100204
+
+湖南电信分省   折扣935
+30:100248
+50:100249
+100:100250
+200:100251
+
+四川电信分省   折扣925
+30:100197
+50:100198
+100:100199
+200:100200
+
+广东电信分省   折扣94
+30:100220
+50:100221
+100:100222
+200:100223
+
+江苏电信分省  折扣935
+30:100209
+50:100210
+100:100211
+200:100212
+
+新疆电信分省  折扣925
+30:100258
+50:100259
+100:100260
+200:100261
+
+海南电信分省  折扣925
+30:100265
+50:100266
+100:100267
+200:100268

+ 14 - 0
helper/refill/api/xyz/meihan_fs/开户信息.txt

@@ -0,0 +1,14 @@
+后台地址:http://47.106.88.10:8888
+帐号:BJYYDFS
+密码:193312
+二级密码:Sdij1797
+appId:WtCDoePp9g
+appSecret:EQDmGGUwJLkjWFIE
+后台-商品列表,可查看已配置商品信息
+后台-安全中心,可配置IP白名单
+接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
+话费直充接口:http://47.106.88.10:8911/api/hf/order/submit
+通用直充接口:http://47.106.88.10:8911/api/order/submit
+卡密提取接口:http://47.106.88.10:8911/api/card/get
+查询接口接口:http://47.106.88.10:8911/api/order/query
+余额查询接口:http://47.106.88.10:8911/api/account/balance

+ 67 - 0
helper/refill/api/yl/meihan_fs/RefillCallBack.php

@@ -0,0 +1,67 @@
+<?php
+namespace refill\meihan_fs;
+
+require_once(BASE_HELPER_RAPI_PATH . '/meihan_fs/config.php');
+
+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 sign($params)
+    {
+        $params['appSecret'] = config::APP_SECRET;
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            if($this->check_empty($value) === false) {
+                $content .= "{$key}={$value}&";
+            }
+        }
+        $content = rtrim($content, '&');
+        return md5($content);
+    }
+
+    private function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['orderStatus']);
+        $order_sn = $params['outOrderId'];
+        $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['ext1']) == 'null' ? '' : $params['ext1'];
+            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];
+        }
+    }
+}

+ 173 - 0
helper/refill/api/yl/meihan_fs/RefillPhone.php

@@ -0,0 +1,173 @@
+<?php
+
+namespace refill\meihan_fs;
+
+require_once(BASE_HELPER_RAPI_PATH . '/meihan_fs/config.php');
+
+use refill;
+use Log;
+
+class RefillPhone extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    public function goods($quality,int $amount,int $card_type,$regin_no,$other)
+    {
+        [$goods_id, $price] = parent::goods($quality,$amount,$card_type,$regin_no,$other);
+        if($goods_id <= 0) return [0,0];
+        $key = "{$card_type}-{$amount}-{$regin_no}";
+        $price = config::Price[$key];
+        if(empty($price)) {
+            Log::record("channel cannot find price where name={$this->mName}, goods_id = {$goods_id} card_type={$card_type} amount={$amount} regin_no={$regin_no}",Log::ERR);
+            return [0,0];
+        } else {
+            return [$goods_id,ncPriceFormat($price)];
+        }
+    }
+
+    private function req_params(int $phone, int $amount, int $card_type, string $order_sn, $regin_no)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['outOrderId'] = $order_sn;
+        $params['uuid'] = $phone;
+        $params['itemId'] = config::PRODUCT[$card_type][$regin_no][$amount];
+        $params['itemFace'] = $amount;
+        $params['callbackUrl'] = config::NOTIFY_URL;
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
+    {
+        $regin_no = $params['regin_no'] ?? -1;
+        if($regin_no <= 0) {
+            return [false, '省份获取错误', false];
+        }
+        $order_sn = $params['order_sn'];
+        $params = $this->req_params($card_no, $amount, $card_type, $order_sn, $regin_no);
+        if(empty($params['itemId'])) {
+            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'] === '00') {
+                return [true, $resp['orderId'], false];
+            } elseif (in_array($resp['code'], config::ERRCODES, true)) {
+                return [false, $resp['msg'], false];
+            } elseif (in_array($resp['code'], ['-22', '-23', '-99'], true)) {
+                $net_errno = "HTTP-{$resp['code']}";
+                return [false, $resp['msg'], true];
+            } else {
+                $net_errno = "HTTP-998";
+                return [false, $resp['msg'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['outOrderId'] = $refill_info['order_sn'];
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        $params['sign'] = $this->sign($params);
+
+        $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, '网络错误'];
+            }
+            elseif ($resp['code'] === '00')
+            {
+                $status = $resp['orderStatus'];
+                if ($status === '2') {
+                    $updata['official_sn'] = $resp['ext1'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === '3') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === '1') {
+                    $order_state = ORDER_STATE_SEND;
+                } elseif ($status === '4' && (time() - $refill_info['commit_time'] >= 600)) {
+                    $order_state = ORDER_STATE_NOEXIST;
+                } else {
+                    return [false, $resp['msg']];
+                }
+                return [true, $order_state];
+            }
+            else
+            {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['appId'] = config::APP_ID;
+        $params['timestamp'] = date("YmdHis").$this->get_millisecond();
+        $params['sign'] = $this->sign($params);
+
+        $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['code'] === '00') {
+                return [true, $resp['balance']];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    /**
+     * 获取毫秒级别的时间戳
+     */
+    private function get_millisecond()
+    {
+        list($usec, $sec) = explode(" ", microtime());
+        return round($usec*1000);
+    }
+
+    private function sign($params)
+    {
+        $params['appSecret'] = config::APP_SECRET;
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            if($this->check_empty($value) === false) {
+                $content .= "{$key}={$value}&";
+            }
+        }
+        $content = rtrim($content, '&');
+        return md5($content);
+    }
+}

+ 137 - 0
helper/refill/api/yl/meihan_fs/config.php

@@ -0,0 +1,137 @@
+<?php
+
+
+namespace refill\meihan_fs;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://47.106.88.10:8911/api/hf/order/submit';
+    const QUERY_URL = 'http://47.106.88.10:8911/api/order/query';
+    const BALANCE_URL = 'http://47.106.88.10:8911/api/account/balance';
+
+    const APP_ID = 'YUCtl1U1wz';
+    const APP_SECRET = 'MpEjJRiCIlAkYoWm';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_meihan_fs.php";
+
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+    const ERRCODES = ['-10', '-12', '-13', '-14', '-15', '-16', '-18', '-21'];
+
+    const PRODUCT = [
+        mtopcard\ChinaMobileCard => [
+            //江苏
+            10 => [
+                30  => 100173,
+                50  => 100174,
+                100 => 100175,
+                200 => 100176,
+            ],
+            //贵州
+            24 => [
+                30  => 100177,
+                50  => 100178,
+                100 => 100179,
+                200 => 100180,
+            ],
+            //福建
+            13 => [
+                30  => 100181,
+                50  => 100182,
+                100 => 100183,
+                200 => 100184,
+            ],
+            //云南
+            25 => [
+                30  => 100189,
+                50  => 100190,
+                100 => 100191,
+                200 => 100192,
+            ],
+            //广西
+            20 => [
+                30  => 100193,
+                50  => 100194,
+                100 => 100195,
+                200 => 100196,
+            ],
+            //江西
+            14 => [
+                50  => 100337,
+                100 => 100338,
+                200 => 100339,
+            ],
+        ],
+
+        mtopcard\ChinaTelecomCard => [
+            //福建
+            13 => [
+                30  => 100201,
+                50  => 100202,
+                100 => 100203,
+                200 => 100204,
+            ],
+            //湖南
+            18 => [
+                30  => 100248,
+                50  => 100249,
+                100 => 100250,
+                200 => 100251,
+            ],
+            //四川
+            23 => [
+                30  => 100197,
+                50  => 100198,
+                100 => 100199,
+                200 => 100200,
+            ],
+            //广东
+            19 => [
+                30  => 100220,
+                50  => 100221,
+                100 => 100222,
+                200 => 100223,
+            ],
+            //江苏
+            10 => [
+                30  => 100209,
+                50  => 100210,
+                100 => 100211,
+                200 => 100212,
+            ],
+            //新疆
+            31 => [
+                30  => 100258,
+                50  => 100259,
+                100 => 100260,
+                200 => 100261,
+            ],
+            //海南
+            21 => [
+                30  => 100265,
+                50  => 100266,
+                100 => 100267,
+                200 => 100268,
+            ],
+        ],
+    ];
+
+    //key格式 卡类型-面值-regin_no
+    const Price = [
+        //移动
+        "4-30-10" => 28.35, "4-50-10" => 47.25, "4-100-10" => 94.5, "4-200-10" => 189,//江苏 10
+        "4-30-24" => 27.6, "4-50-24" => 46, "4-100-24" => 92, "4-200-24" => 184,//贵州 24
+        "4-30-13" => 28.05, "4-50-13" => 46.75, "4-100-13" => 93.5, "4-200-13" => 187,//福建 13
+        "4-30-25" => 27.9, "4-50-25" => 46.5, "4-100-25" => 93, "4-200-25" => 186,//云南 25
+        "4-30-20" => 28.05, "4-50-20" => 46.75, "4-100-20" => 93.5, "4-200-20" => 187,//广西 20
+        "4-50-14" => 46.75, "4-100-14" => 93.5, "4-200-14" => 187,//江西 14
+
+        //电信
+        "6-30-13" => 27.75, "6-50-13" => 46.25, "6-100-13" => 92.5, "6-200-13" => 185,//福建 13
+        "6-30-18" => 28.05, "6-50-18" => 46.75, "6-100-18" => 93.5, "6-200-18" => 187,//湖南 18
+        "6-30-23" => 27.75, "6-50-23" => 46.25, "6-100-23" => 92.5, "6-200-23" => 185,//四川 23
+        "6-30-19" => 28.2, "6-50-19" => 47, "6-100-19" => 94, "6-200-19" => 188,//广东 19
+        "6-30-10" => 28.05, "6-50-10" => 46.75, "6-100-10" => 93.5, "6-200-10" => 187,//江苏 10
+        "6-30-31" => 27.75, "6-50-31" => 46.25, "6-100-31" => 92.5, "6-200-31" => 185,//新疆 31
+        "6-30-21" => 27.75, "6-50-21" => 46.25, "6-100-21" => 92.5, "6-200-21" => 185,//海南 21
+    ];
+}

+ 81 - 0
helper/refill/api/yl/meihan_fs/商品编码.txt

@@ -0,0 +1,81 @@
+江苏移动分省(暂时配置945,目前不正常)
+30:100173
+50:100174
+100:100175
+200:100176
+
+贵州移动分省    折扣92
+30:100177
+50:100178
+100:100179
+200:100180
+
+福建移动分省   折扣935
+30:100181
+50:100182
+100:100183
+200:100184
+
+云南移动分省    折扣93
+30:100189
+50:100190
+100:100191
+200:100192
+
+广西移动分省    折扣935
+30:100193
+50:100194
+100:100195
+200:100196
+
+江西移动分省    折扣935
+50:100337
+100:100338
+200:100339
+
+
+
+
+
+
+福建电信分省   折扣925
+30:100201
+50:100202
+100:100203
+200:100204
+
+湖南电信分省   折扣935
+30:100248
+50:100249
+100:100250
+200:100251
+
+四川电信分省   折扣925
+30:100197
+50:100198
+100:100199
+200:100200
+
+广东电信分省   折扣94
+30:100220
+50:100221
+100:100222
+200:100223
+
+江苏电信分省  折扣935
+30:100209
+50:100210
+100:100211
+200:100212
+
+新疆电信分省  折扣925
+30:100258
+50:100259
+100:100260
+200:100261
+
+海南电信分省  折扣925
+30:100265
+50:100266
+100:100267
+200:100268

+ 15 - 0
helper/refill/api/yl/meihan_fs/开户信息.txt

@@ -0,0 +1,15 @@
+后台地址:http://47.106.88.10:8888
+帐号:BJYLFS
+密码:143259
+二级密码:qqMa9832
+appId:YUCtl1U1wz
+appSecret:MpEjJRiCIlAkYoWm
+后台-商品列表,可查看已配置商品信息
+后台-安全中心,可配置IP白名单
+接口文档:https://www.showdoc.com.cn/1686453783298366/7925312871840290
+话费直充接口:http://47.106.88.10:8911/api/hf/order/submit
+通用直充接口:http://47.106.88.10:8911/api/order/submit
+卡密提取接口:http://47.106.88.10:8911/api/card/get
+查询接口接口:http://47.106.88.10:8911/api/order/query
+余额查询接口:http://47.106.88.10:8911/api/account/balance
+椰林网厅账户

+ 4 - 0
mobile/callback/refill_meihan_fs.php

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

+ 14 - 0
test/TestRefill.php

@@ -3269,6 +3269,20 @@ class TestRefill extends TestCase
         $resp = $provider->notify($params);
     }
 
+    public function testMeihan_fs()
+    {
+//        $provider = $this->getProvider('meihan_fs');
+//        $resp = $provider->balance();
+//        $resp = $provider->add(18074608795, 6, 30, ['order_sn' => $this->make_sn(), 'regin_no' => 18]);
+//        $resp = $provider->query(['order_sn' => '56911681870334278247']);
+
+        $body = '{"orderId":"230419101229102385","appId":"WtCDoePp9g","outOrderId":"56911681870334278247","sign":"91eb93d735dd468ab24e8cb6c7c4256f","orderStatus":"3","completeTime":"20230419101628","orderDesc":"\u8ba2\u5355\u5931\u8d25"}';
+        $params = json_decode($body, true);
+        $provider = $this->getProvider('meihan_fs', 'RefillCallBack');
+        $ret = $provider->verify($params);
+        $resp = $provider->notify($params);
+    }
+
     public function testAmingjd()
     {
 //        $provider = new refill\amingjd\RefillPhone([]);