Browse Source

Merge branch 'rchannel' into raccount

stanley-king 1 năm trước cách đây
mục cha
commit
44044c71cb

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

@@ -235,6 +235,30 @@ $jumi_sec_oil = ['name' => 'jumi_sec', 'store_id' => 278,'qualitys' => '5',
     ],
     'period' => [], 'refill_type' => 'api'];
 
+$feihan_oil = ['name' => 'feihan', 'store_id' => 317, 'qualitys' => '5',
+    'amount' => [
+        50 => [
+            ['goods_id' => 8610, 'price' => 50.25, 'quality' => 5, 'card_type' => 'petrochina']
+        ],
+        100 => [
+            ['goods_id' => 6611, 'price' => 100.5, 'quality' => 5, 'card_type' => 'petrochina'],
+            ['goods_id' => 6611, 'price' => 100.7, 'quality' => 5, 'card_type' => 'sinopec'],
+        ],
+        200 => [
+            ['goods_id' => 6612, 'price' => 201, 'quality' => 5, 'card_type' => 'petrochina'],
+            ['goods_id' => 6612, 'price' => 201.4, 'quality' => 5, 'card_type' => 'sinopec'],
+        ],
+        500 => [
+            ['goods_id' => 6613, 'price' => 502.5, 'quality' => 5, 'card_type' => 'petrochina'],
+            ['goods_id' => 6613, 'price' => 502.5, 'quality' => 5, 'card_type' => 'sinopec'],
+        ],
+        1000 => [
+            ['goods_id' => 6614, 'price' => 1005, 'quality' => 5, 'card_type' => 'petrochina'],
+            ['goods_id' => 6614, 'price' => 1005, 'quality' => 5, 'card_type' => 'sinopec'],
+        ],
+    ],
+    'period' => [], 'refill_type' => 'api'];
+
 $oil_providers = [
 //    ['name' => 'tianjt', 'cfg' => $tianjt_oil],
 //    ['name' => 'suhctm', 'cfg' => $suhctm_oil],
@@ -256,6 +280,7 @@ $oil_providers = [
     ['name' => 'xunyinoil', 'cfg' => $xunyinoil_oil],
     ['name' => 'menggu', 'cfg' => $menggu_oil],
     ['name' => 'jumi_sec', 'cfg' => $jumi_sec_oil],
+    ['name' => 'feihan', 'cfg' => $feihan_oil],
 ];
 $config['oil_providers'] = $oil_providers;
 

+ 35 - 0
helper/refill/api/xyz/feihan/RefillCallBack.php

@@ -0,0 +1,35 @@
+<?php
+namespace refill\feihan;
+
+require_once(BASE_HELPER_RAPI_PATH . '/feihan/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        return true;
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['ret_code']);
+        $order_sn = $params['sporder_id'];
+        $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 === 1) {
+            $official_sn = strtolower($params['serial_no']) == 'null' ? '' : $params['serial_no'];
+            $data['official_sn'] = $official_sn;
+            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];
+        }
+    }
+}

+ 167 - 0
helper/refill/api/xyz/feihan/RefillOil.php

@@ -0,0 +1,167 @@
+<?php
+
+namespace refill\feihan;
+
+require_once(BASE_HELPER_RAPI_PATH . '/feihan/config.php');
+
+use refill;
+use Log;
+
+class RefillOil extends refill\IRefillPhone
+{
+    public function __construct($cfgs)
+    {
+        parent::__construct($cfgs);
+    }
+
+    private function req_params(int $card_no, int $amount, int $card_type, string $order_sn)
+    {
+        $params['userId'] = config::USER_ID;
+        $params['userPws'] = md5(config::USER_PWS);
+        $params['cardId'] = config::Product[$card_type][$amount];
+        $params['buyNum'] = 1;
+        $params['spOrderId'] = $order_sn;
+        $params['orderTime'] = date("YmdHis");
+        $params['customerNo'] = $card_no;
+        $params['retUrl'] = config::NOTIFY_URL;
+        $params['version'] = '6.0';
+        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['md5Str'] = $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);
+
+            $retCode = $resp['retCode'];
+            if (empty($resp)) {
+                return [false, '网络错误', true];
+            } elseif ($retCode === '1') {
+                return [true, $resp['orderId'], false];
+            } elseif (in_array($retCode, config::ERR_NOS, true)) {
+                return [false, $resp['errMsg'], false];
+            } elseif ($retCode === '9999') {
+                $net_errno = "HTTP-{$retCode}";
+                return [false, $resp['errMsg'], true];
+            } else {
+                $err = 998;
+                $net_errno = "HTTP-{$err}";
+                return [false, $resp['errMsg'], true];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['userid'] = config::USER_ID;
+        $params['userpws'] = md5(config::USER_PWS);
+        $params['sporder_id'] = $refill_info['order_sn'];
+        $params['version'] = '6.0';
+
+        $key = config::KEY;
+        $content = "{$params['userid']}{$params['userpws']}{$params['sporder_id']}{$key}";
+        $params['md5_str'] = strtoupper(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 = $this->xmlToArray($resp, 'GB2312');
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            }
+            elseif ($resp['retcode'] === '1')
+            {
+                $status = $resp['game_state'];
+                if ($status === '1') {
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === '9') {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($status === '0') {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['err_msg']];
+                }
+                return [true, $order_state];
+            }
+            elseif ($resp['retcode'] === '1010' && (time() - $refill_info['commit_time'] > 600))
+            {
+                return [true, ORDER_STATE_NOEXIST];
+            }
+            else
+            {
+                return [false, $resp['err_msg']];
+
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['userid'] = config::USER_ID;
+        $params['userpws'] = md5(config::USER_PWS);
+        $params['version'] = '6.0';
+
+        $resp = http_request(config::BALANCE_URL, $params, 'POST', false, config::ExtHeaders);
+
+        if (empty($resp)) {
+            return [false, '网络错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = $this->xmlToArray($resp, 'GB2312');
+
+            if (empty($resp)) {
+                return [false, '网络错误'];
+            } elseif ($resp['retcode'] === '1') {
+                return [true, $resp['totalBalance']];
+            } else {
+                return [false, $resp['err_msg']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        $key = config::KEY;
+        $content = "{$params['userId']}{$params['userPws']}{$params['cardId']}{$params['buyNum']}{$params['spOrderId']}{$params['orderTime']}{$params['customerNo']}";
+        $content .= $key;
+        return strtoupper(md5($content));
+    }
+
+    public function xmlToArray($xml, $encode = 'GBK')
+    {
+        $getEncoder = function ($xml,$default_encode)
+        {
+            $ret = preg_match("/<?xml\s+[\s\S]*(encoding=[\"']([^\"']*)[\"'])[\s\S]*?>/", $xml, $res);
+            if($ret !== false && count($res) === 3) {
+                return [$res[2], $res[1]];
+            } else {
+                return [$default_encode,'encoding="' . $default_encode . '"'];
+            }
+        };
+
+        [$encode, $replace_str] = $getEncoder($xml, $encode);
+        $xml = mb_convert_encoding($xml,"utf-8","{$encode}");
+        $xml = str_replace($replace_str, "encoding='utf-8'", $xml);
+        return refill\util::xmlToArray($xml);
+    }
+}

+ 30 - 0
helper/refill/api/xyz/feihan/api.txt

@@ -0,0 +1,30 @@
+userid:A230504001
+userpws:69D5C1C7B8C476A3
+keystr:736E75E8BD6A943B
+
+测试产品
+64349807  全国中石油加油卡卡密200元
+加油卡直充200元的商品编号 64157003
+
+http://openapi.ofpay.com
+
+中石油
+64349107	50
+64349106	100
+64349105	200
+64349103	500
+64349101	1000
+
+中石化
+64313605	50
+64157004	100
+64157003	200
+64157002	500
+64157001	1000
+
+
+ret_code                充值状态     1成功   9失败
+ordersuccesstime   充值完成时间
+sporder_id             外部订单号
+err_msg                 失败原因
+serial_no                官方流水号

+ 37 - 0
helper/refill/api/xyz/feihan/config.php

@@ -0,0 +1,37 @@
+<?php
+namespace refill\feihan;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://api2.ofpay.com/newOnlineOrder.do';
+    const QUERY_URL= 'http://api2.ofpay.com/queryOrderInfo.do';
+    const BALANCE_URL = 'http://api2.ofpay.com/newqueryuserinfo.do';
+
+    const USER_ID = 'A230504001';
+    const USER_PWS = '69D5C1C7B8C476A3';
+    const KEY = '736E75E8BD6A943B';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_feihan.php";
+    const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
+
+    const ERR_NOS = [
+        '1001', '1002', '1003', '1004', '1005', '1006', '1007', '1008', '319', '321', '331', '9998', '4001'
+    ];
+
+    const Product = [
+        mtopcard\PetroChinaCard => [
+            50 => 64349107,
+            100 => 64349106,
+            200 => 64349105,
+            500 => 64349103,
+            1000 => 64349101,
+        ],
+        mtopcard\SinopecCard => [
+            50 => 64313605,
+            100 => 64157004,
+            200 => 64157003,
+            500 => 64157002,
+            1000 => 64157001,
+        ],
+    ];
+}

BIN
helper/refill/api/xyz/feihan/商品编码.jpg


+ 2 - 0
helper/refill/api/xyz/yongjia/API信息.txt

@@ -4,8 +4,10 @@ ID:1
 
 
 下单地址:http://123.56.68.57:1008/hqorder/api/submit
+油卡下单地址:http://123.56.68.57:1008/hqorder/api/youkasubmit
 查询地址:http://123.56.68.57:1008/hqorder/api/query
 查询余额地址:http://123.56.68.57:1008/hqorder/api/balance
 
 测试产品(需传产品编码)
 3000200	全国电信200元
+999999	油卡100元

+ 32 - 6
helper/refill/api/xyz/yongjia/RefillOil.php

@@ -6,28 +6,54 @@ require_once(BASE_HELPER_RAPI_PATH . '/yongjia/config.php');
 
 use refill;
 use Log;
+use mtopcard;
 
-class RefillOil extends refill\IRefillOil
+class RefillPhone extends refill\IRefillThird
 {
     public function __construct($cfgs)
     {
         parent::__construct($cfgs);
     }
 
-    private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
+    private function req_params(int $phone, string $order_sn, $product_code, $province)
     {
         $params['mchid'] = config::MCHID;
         $params['orderid'] = $order_sn;
         $params['number'] = $phone;
-        $params['productid'] = config::PRODUCT[$card_type][$amount];
+        $params['productid'] = $product_code;
         $params['timestamp'] = $this->getMillisecond();
         $params['backurl'] = config::NOTIFY_URL;
+        $params['youka'] = mtopcard\ProvinceList[$province];
         return $params;
     }
 
-    public function add($card_no, $card_type, $amount, $input, &$net_errno = 0)
+
+    private function getProductCode($goods_id, $sys_pcode)
+    {
+        $thrid_refill = Model('thrid_refill');
+        $product = $thrid_refill->getProviderProduct($this->mStoreID,$goods_id,$sys_pcode);
+        if (empty($product)) {
+            return false;
+        } else {
+            return $product['channel_code'];
+        }
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0)
     {
-        $params = $this->req_params($card_no, $card_type, $amount, $input['order_sn']);
+        $goods_id = intval($params['goods_id']);
+        $province = $params['province'] ?? -1;
+        if($province < 0) {
+            return [false, '省份获取错误', false];
+        }
+
+        $product_code = $this->getProductCode($goods_id, $params['product_code']);
+        if(empty($product_code)) {
+            return [false, '产品未开启', false];
+        }
+        Model('thrid_refill')->edit_third($params['order_id'], ['chcode' => $product_code]);
+
+        $params = $this->req_params($card_no, $params['order_sn'], $product_code, $province);
         $sign = $this->sign($params);
         $params['sign'] = $sign;
 
@@ -128,7 +154,7 @@ class RefillOil extends refill\IRefillOil
     {
         $key = config::KEY;
         $content  = "mchid={$params['mchid']}&orderid={$params['orderid']}&number={$params['number']}&productid={$params['productid']}";
-        $content .= "&timestamp={$params['timestamp']}&key={$key}";
+        $content .= "&timestamp={$params['timestamp']}&youka={$params['youka']}&key={$key}";
         return md5($content);
     }
 

+ 1 - 14
helper/refill/api/xyz/yongjia/config.php

@@ -3,10 +3,9 @@
 
 namespace refill\yongjia;
 
-use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://123.56.68.57:1008/hqorder/api/submit';
+    const ORDER_URL = 'http://123.56.68.57:1008/hqorder/api/youkasubmit';
     const QUERY_URL = 'http://123.56.68.57:1008/hqorder/api/query';
     const BALANCE_URL = 'http://123.56.68.57:1008/hqorder/api/balance';
 
@@ -14,17 +13,5 @@ class config
     const KEY = '52e4fd509410446a8259fd8a93de6c85';
 //    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yongjia.php";
     const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
-
-    const PRODUCT = [
-        mtopcard\ChinaMobileCard => [
-
-        ],
-        mtopcard\ChinaUnicomCard => [
-
-        ],
-        mtopcard\ChinaTelecomCard => [
-            200 => 3000200
-        ]
-    ];
     const ExtHeaders = ['Content-Type: application/json'];
 }

BIN
helper/refill/api/xyz/yongjia/hq接口文档V1.0.docx


+ 40 - 0
helper/refill/api/yl/by_online/API信息.txt

@@ -0,0 +1,40 @@
+测试域名 http://commapitest.bjzykj.work
+正式域名 http://commapi.bjzykj.work
+
+appId 1 商户编号(需要同运
+营开通)
+version 1.0 版本号 默认 1.0
+sign 123456 签名密钥
+
+
+1 北京
+2 天津
+3 上海
+4 重庆
+5 河北
+6 山西
+8 辽宁
+9 吉林
+10 黑龙江
+11 江苏
+12 浙江
+13 安徽
+14 福建
+15 江西
+16 山东
+17 河南
+18 湖北
+19 湖南
+20 广东
+21 甘肃
+22 四川
+23 贵州
+24 海南
+25 云南
+26 青海
+27 陕西
+28 广西
+29 西藏
+30 宁夏
+31 新疆
+32 内蒙古

+ 39 - 0
helper/refill/api/yl/by_online/RefillCallBack.php

@@ -0,0 +1,39 @@
+<?php
+namespace refill\by_online;
+
+require_once(BASE_HELPER_RAPI_PATH . '/by_online/config.php');
+
+use refill;
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['sign']);
+        $sign = config::sign($input);
+        if ($params['sign'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    public function notify($params)
+    {
+        $status = intval($params['order_status']);
+        $order_sn = $params['merchantorder_no'];
+        $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 === 7) {
+            return [$order_id, true, false, true];
+        } elseif (in_array($status, [3, 4, 6], true)) {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
+        }
+    }
+}

+ 128 - 0
helper/refill/api/yl/by_online/RefillPhone.php

@@ -0,0 +1,128 @@
+<?php
+
+namespace refill\by_online;
+
+require_once(BASE_HELPER_RAPI_PATH . '/by_online/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, $regin_no)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['version'] = '1.0';
+        $params['merchantOrderNo'] = $order_sn;
+        $params['productId'] = config::ProductIdS[$card_type][$amount];
+        $params['account'] = "{$phone}";
+        $params['amt'] = $amount * 100;
+        $params['callbackUrl'] = config::NOTIFY_URL;
+        $params['provinceId'] = config::ProvinceMap[$regin_no];
+        $params['parameter'] = '';
+        $params['extra'] = '';
+
+        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];
+        }
+        $params = $this->req_params($card_no, $amount, $card_type, $params['order_sn'], $regin_no);
+        $sign = config::sign($params);
+        $params['sign'] = $sign;
+
+        $params = json_encode($params);
+        $resp = http_post_data(config::ORDER_URL, $params , 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'] === 1000) {
+                return [true, $resp['data']['order_sn'], false];
+            } else {
+                return [false, $resp['msg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['appId'] = config::APP_ID;
+        $params['version'] = '1.0';
+        $params['merchantOrderNo'] = $refill_info['order_sn'];
+        $sign = config::sign($params);
+        $params['sign'] = $sign;
+
+        $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'] === 1000)
+            {
+                $status = $resp['data']['order_status'];
+                if ($status === 7) {
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif (in_array($status, [3, 4, 6], true)) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($status, [0, 1, 2, 5], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $status];
+                }
+                return [true, $order_state];
+            }
+            else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+
+    public function balance()
+    {
+        $params['appId'] = config::APP_ID;
+        $params['version'] = '1.0';
+        $sign = config::sign($params);
+        $params['sign'] = $sign;
+
+        $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'] === 1000) {
+                return [true, $resp['data']['balance']*100];
+            } else {
+                return [false, $resp['msg']];
+            }
+        }
+    }
+}

+ 89 - 0
helper/refill/api/yl/by_online/config.php

@@ -0,0 +1,89 @@
+<?php
+namespace refill\by_online;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://commapitest.bjzykj.work/comm/recharge';
+    const QUERY_URL = 'http://commapitest.bjzykj.work/comm/orderQuery';
+    const BALANCE_URL = 'http://commapitest.bjzykj.work/comm/account';
+
+    const APP_ID = '1';
+    const APP_KEY = 's33obkIGnCxgMM1eIXR95KSDSKgQdb6W';
+//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_by_online.php";
+    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
+
+    const ExtHeaders = ['Content-Type: application/json'];
+
+    const ProductIdS = [
+        mtopcard\ChinaMobileCard =>
+            [
+                50  => '10003',
+                100 => '10004',
+                200 => '10005',
+                300 => '10006',
+                500 => '10007',
+            ],
+        mtopcard\ChinaUnicomCard =>
+            [
+                50  => '1',
+                100 => '10012',
+                200 => '10013',
+                300 => '10014',
+            ],
+        mtopcard\ChinaTelecomCard =>
+            [
+                50  => '10019',
+                100 => '10020',
+                200 => '10021',
+                300 => '10022',
+                500 => '10023',
+            ],
+    ];
+
+    public static function sign($params)
+    {
+        ksort($params);
+        $content = '';
+        foreach ($params as $key => $value) {
+            $content .= "{$key}={$value}&";
+        }
+        $content .= config::APP_KEY;
+        return md5($content);
+    }
+
+    const ProvinceMap = [
+        1	=> 1,  //'北京',
+        2	=> 2,  //'天津',
+        3	=> 5, //'河北',
+        4	=> 6, //'山西',
+        5	=> 32,  //'内蒙古',
+        6	=> 8,  //'辽宁',
+        7	=> 9,  //'吉林',
+        8	=> 10,  //'黑龙江',
+        9	=> 3,  //'上海',
+        10	=> 11, //'江苏',
+        11	=> 12, //'浙江',
+        12	=> 13, //'安徽',
+        13	=> 14, //'福建',
+        14	=> 15, //'江西',
+        15	=> 16, //'山东',
+        16	=> 17,  //'河南',
+        17	=> 18, //'湖北',
+        18	=> 19, //'湖南',
+        19	=> 20, //'广东',
+        20	=> 28, //'广西',
+        21	=> 24, //'海南',
+        22	=> 4,  //'重庆',
+        23	=> 22, //'四川',
+        24	=> 23, //'贵州',
+        25	=> 25, //'云南',
+        26	=> 29, //'西藏',
+        27	=> 27, //'陕西',
+        28	=> 21, //'甘肃',
+        29	=> 26, //'青海',
+        30	=> 30, //'宁夏',
+        31	=> 31  //'新疆'
+    ];
+
+}

BIN
helper/refill/api/yl/by_online/纸莺运营商数据管理平台对外接口.pdf


+ 4 - 0
mobile/callback/refill_feihan.php

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

+ 25 - 5
test/TestRefill.php

@@ -3251,17 +3251,16 @@ class TestRefill extends TestCase
 
     public function testYongjia()
     {
-//        $provider = $this->getProvider('yongjia','RefillOil');
+//        $provider = $this->getProvider('yongjia');
 //        $resp = $provider->balance();
-//        $resp = $provider->add(18074608795, 6, 200, ['order_sn' => $this->make_sn()]);
-//        $resp = $provider->query(['order_sn' => '67461681184143372378']);
+//        $resp = $provider->add(18074608795, 6, 200, ['order_sn' => $this->make_sn(), 'province' => 1, 'product_code' => 'XYZ100777', 'goods_id' => 6978]);
+//        $resp = $provider->query(['order_sn' => '86061683172050676749']);
 
-        $body = '{"number":"18074608795","mchid":"1","orderid":"67461681184143372378","price":"200.0","voucher":"","sign":"b9c011c70734707b88351ec5efd96d98","oid":134,"status":"3"}';
+        $body = '{"number":"18074608795","mchid":"1","orderid":"86061683172050676749","price":"100.0","voucher":"","sign":"3d62a44c8f49a158e3cb8d58518bc193","oid":162,"status":"3"}';
         $params = json_decode($body, true);
         $provider = $this->getProvider('yongjia', 'RefillCallback');
         $ret = $provider->verify($params);
         $resp = $provider->notify($params);
-
     }
 
     public function testHuiyuan()
@@ -3320,6 +3319,27 @@ class TestRefill extends TestCase
 //        $resp = $provider->notify($params);
     }
 
+    public function testGetXMLEncoding()
+    {
+        $header = '<?xml version="1.0" encoding="GB2312"?>';
+/*        $ret = preg_match("/<?xml\s+[\s\S]*?>/", $header, $res);*/
+        $ret = preg_match("/<?xml\s+[\s\S]*encoding=[\"']([^\"']*)[\"'][\s\S]*?>/", $header, $res);
+    }
+
+    public function testfeihan()
+    {
+        $provider = $this->getProvider('feihan', 'RefillOil');
+        $resp = $provider->balance();
+        $resp = $provider->add(9030230005180327, 1, 200, ['order_sn' => $this->make_sn()]);
+        $resp = $provider->query(['order_sn' => '18141682668825332400']);
+
+//        $body = '{"err_msg":"","ordersuccesstime":"20230428161615","sporder_id":"18141682668825332400","ret_code":"1"}';
+//        $params = json_decode($body, true);
+//        $provider = $this->getProvider('feihan', 'RefillCallBack');
+//        $ret = $provider->verify($params);
+//        $resp = $provider->notify($params);
+    }
+
     public function testAmingjd()
     {
 //        $provider = new refill\amingjd\RefillPhone([]);

+ 15 - 0
test/TestRefillYl.php

@@ -980,4 +980,19 @@ class TestRefillYl extends TestCase
         $provider = $this->getProvider('meihan');
         $resp = $provider->balance();
     }
+
+    public function testBy_online()
+    {
+//        $provider = $this->getProvider('by_online');
+//        $resp = $provider->balance();
+//        $resp = $provider->add(18500608333, 5, 50, ['order_sn' => $this->make_sn(), 'regin_no' => 1]);
+//        $resp = $provider->query(['order_sn' => '70831682580641580700']);
+
+        $body = '{"appId":"1","merchantorder_no":"70831682580641580700","order_sn":"2023042715304843866056509749","pay_mobile":"18500608333","amount":"5000","real_price":"5000","order_status":"7","extra":"","pay_time":"2023-04-27 15:30:48","completion_time":"2023-04-27 15:30:48","sign":"4ac35a9afc969eb7ad972d43909c8b41"}';
+        $params = json_decode($body, true);
+        $provider = $this->getProvider('by_online', 'RefillCallBack');
+        $ret = $provider->verify($params);
+        $resp = $provider->notify($params);
+
+    }
 }