Browse Source

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

ayHaru 4 years ago
parent
commit
04b3a1f349

+ 1 - 1
admin/templates/default/provider.amount.control.php

@@ -13,7 +13,7 @@
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow" class="classA" data-type="2-slow"><span>慢充话费单量控制</span></a></li>
 
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=common" class="classA" data-type="1-common"><span>普通油卡单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=fast" class="classA" data-type="1-fast"><span>快充油卡单量控制</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=slow" class="classA" data-type="1-slow"><span>慢充油卡单量控制</span></a></li>
             </ul>
         </div>
     </div>

+ 1 - 1
admin/templates/default/provider.index.php

@@ -13,7 +13,7 @@
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=2&form=slow"><span>慢充话费单量控制</span></a></li>
 
                 <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=common"><span>普通油卡单量控制</span></a></li>
-                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=fast"><span>快充油卡单量控制</span></a></li>
+                <li><a href="index.php?act=merchant&op=provider_amount_control&type=1&form=slow"><span>慢充油卡单量控制</span></a></li>
             </ul>
         </div>
     </div>

+ 56 - 3
data/config/win/refill.ini.php

@@ -94,6 +94,16 @@ $gftdsinop_oil = ['name' => 'gftdsinop', 'store_id' => 20,'qualitys' => '1',
     ],
     'period' => [], 'refill_type' => 'api'];
 
+#亿畅通中石化通道
+$yichangt_oil = ['name' => 'yichangt', 'store_id' => 50,'qualitys' => '5',
+    'amount' => [
+        100 => [['goods_id' => 6541, 'price' => 96.9, 'quality' => 5, 'card_type' => 'sinopec']],
+        200 => [['goods_id' => 6542, 'price' => 193.8, 'quality' => 5, 'card_type' => 'sinopec']],
+        500 => [['goods_id' => 6543, 'price' => 484.5, 'quality' => 5, 'card_type' => 'sinopec']],
+        1000 => [['goods_id' => 6544, 'price' => 969, 'quality' => 5, 'card_type' => 'sinopec']]
+    ],
+    'period' => [], 'refill_type' => 'api'];
+
 $oil_providers = [
     ['name' => 'tianjt', 'cfg' => $tianjt_oil],
     ['name' => 'suhctm', 'cfg' => $suhctm_oil],
@@ -102,7 +112,8 @@ $oil_providers = [
     ['name' => 'lx', 'cfg' => $lx_oil],
     ['name' => 'saihu', 'cfg' => $saihu_oil],
     ['name' => 'gftd', 'cfg' => $gftd_oil],
-    ['name' => 'gftdsinop', 'cfg' => $gftdsinop_oil]
+    ['name' => 'gftdsinop', 'cfg' => $gftdsinop_oil],
+    ['name' => 'yichangt', 'cfg' => $yichangt_oil]
 ];
 $config['oil_providers'] = $oil_providers;
 
@@ -353,11 +364,11 @@ $weiyi_phone = ['name' => 'weiyi', 'store_id' => 32,'qualitys' => '1',
         ],
         30 => [
             ['goods_id' => 6416, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6416, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6416, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         50 => [
             ['goods_id' => 6417, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6417, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6417, 'price' => 48, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         100 => [
             ['goods_id' => 6418, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -631,6 +642,46 @@ $jumi_phone = ['name' => 'jumi', 'store_id' => 47, 'qualitys' => '2',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$qianqian_phone = ['name' => 'qianqian', 'store_id' => 48, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 6529, 'price' => 9.53, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+//        ],
+//        20 => [
+//            ['goods_id' => 74, 'price' => 19.06, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom'],
+//        ],
+        30 => [
+            ['goods_id' => 6529, 'price' => 28.59, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6529, 'price' => 28.53, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        50 => [
+            ['goods_id' => 6530, 'price' => 47.65, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6530, 'price' => 47.55, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 6531, 'price' => 95.3, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6531, 'price' => 95.1, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 6532, 'price' => 190.6, 'quality' => 1, 'card_type' => 'chinamobile'],
+            ['goods_id' => 6532, 'price' => 190.2, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
+$fengye_phone = ['name' => 'fengye', 'store_id' => 49, 'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 6533, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6534, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6535, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6536, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6537, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6538, 'price' => 189, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6539, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6540, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -660,5 +711,7 @@ $phone_providers = [
     ['name' => 'weiyiman', 'cfg' => $weiyiman_phone],
     ['name' => 'yonghe', 'cfg' => $yonghe_phone],
     ['name' => 'jumi', 'cfg' => $jumi_phone],
+    ['name' => 'qianqian', 'cfg' => $qianqian_phone],
+    ['name' => 'fengye', 'cfg' => $fengye_phone],
 ];
 $config['phone_providers'] = $phone_providers;

+ 28 - 3
data/config/xyz/refill.ini.php

@@ -94,6 +94,16 @@ $gftdsinop_oil = ['name' => 'gftdsinop', 'store_id' => 20,'qualitys' => '1',
     ],
     'period' => [], 'refill_type' => 'api'];
 
+#亿畅通中石化通道
+$yichangt_oil = ['name' => 'yichangt', 'store_id' => 50,'qualitys' => '5',
+    'amount' => [
+        100 => [['goods_id' => 6541, 'price' => 96.9, 'quality' => 5, 'card_type' => 'sinopec']],
+        200 => [['goods_id' => 6542, 'price' => 193.8, 'quality' => 5, 'card_type' => 'sinopec']],
+        500 => [['goods_id' => 6543, 'price' => 484.5, 'quality' => 5, 'card_type' => 'sinopec']],
+        1000 => [['goods_id' => 6544, 'price' => 969, 'quality' => 5, 'card_type' => 'sinopec']]
+    ],
+    'period' => [], 'refill_type' => 'api'];
+
 $oil_providers = [
     ['name' => 'tianjt', 'cfg' => $tianjt_oil],
     ['name' => 'suhctm', 'cfg' => $suhctm_oil],
@@ -102,7 +112,8 @@ $oil_providers = [
     ['name' => 'lx', 'cfg' => $lx_oil],
     ['name' => 'saihu', 'cfg' => $saihu_oil],
     ['name' => 'gftd', 'cfg' => $gftd_oil],
-    ['name' => 'gftdsinop', 'cfg' => $gftdsinop_oil]
+    ['name' => 'gftdsinop', 'cfg' => $gftdsinop_oil],
+    ['name' => 'yichangt', 'cfg' => $yichangt_oil]
 ];
 $config['oil_providers'] = $oil_providers;
 
@@ -353,11 +364,11 @@ $weiyi_phone = ['name' => 'weiyi', 'store_id' => 32,'qualitys' => '1',
         ],
         30 => [
             ['goods_id' => 6416, 'price' => 28.44, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6416, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6416, 'price' => 28.8, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         50 => [
             ['goods_id' => 6417, 'price' => 47.4, 'quality' => 1, 'card_type' => 'chinamobile'],
-            ['goods_id' => 6417, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
+            ['goods_id' => 6417, 'price' => 48, 'quality' => 1, 'card_type' => 'chinaunicom,chinatelecom']
         ],
         100 => [
             ['goods_id' => 6418, 'price' => 94.8, 'quality' => 1, 'card_type' => 'chinamobile'],
@@ -663,6 +674,19 @@ $qianqian_phone = ['name' => 'qianqian', 'store_id' => 48, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$fengye_phone = ['name' => 'fengye', 'store_id' => 49, 'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 6533, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6534, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6535, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6536, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6537, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6538, 'price' => 189, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6539, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6540, 'price' => 472.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -693,5 +717,6 @@ $phone_providers = [
     ['name' => 'yonghe', 'cfg' => $yonghe_phone],
     ['name' => 'jumi', 'cfg' => $jumi_phone],
     ['name' => 'qianqian', 'cfg' => $qianqian_phone],
+    ['name' => 'fengye', 'cfg' => $fengye_phone],
 ];
 $config['phone_providers'] = $phone_providers;

+ 72 - 0
helper/refill/api/xyz/fengye/RefillCallBack.php

@@ -0,0 +1,72 @@
+<?php
+
+
+namespace refill\fengye;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fengye/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;
+        }
+    }
+
+    protected function check_empty($value)
+    {
+        if (!isset($value))
+            return true;
+        if ($value === null)
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($data)
+    {
+        $str = "";
+        ksort($data);
+        $data['queryUrl'] = urlencode($data['queryUrl']);
+        foreach($data as $k => $v){
+            if($this->check_empty($v) === false){
+                $str .= $v;
+            }
+        }
+        return md5($str.config::KEY);
+    }
+
+    //[$order_id, $success, $can_try, $need_handle]
+    public function notify($params)
+    {
+        $status = intval($params['status']);
+        $order_sn = $params['orderNo'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+        $order_id = $order_info['order_id'];
+
+        if ($status === 2) {
+            $data['official_sn'] = strtolower($params['ticketNo']) == 'null' ? '' : $params['ticketNo'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif (in_array($status, [0,1,3])) {
+            return [$order_id, false, true,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 111 - 0
helper/refill/api/xyz/fengye/RefillPhone.php

@@ -0,0 +1,111 @@
+<?php
+
+namespace refill\fengye;
+
+require_once(BASE_HELPER_RAPI_PATH . '/fengye/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['supplierId'] = config::USER_ID;
+        $params['orderNo'] = $order_sn;
+        $params['company'] = config::operator[$card_type];
+        $params['amount'] = $amount;
+        $params['phoneNo'] = $phone;
+        $params['notifyUrl'] = config::NOTIFY_URL;
+
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params)
+    {
+        $params = $this->req_params($card_no, $amount, $card_type, $params['order_sn']);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $params = json_encode($params);
+
+        $resp = http_post_data(config::ORDER_URL, $params , config::ExtHeaders);
+
+        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, $resp['data']['orderId'], false];
+            } else {
+                return [false, $resp['msg'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['supplierId'] = config::USER_ID;
+        $params['orderNo'] = $refill_info['order_sn'];
+        $params['phoneNo'] = $refill_info['card_no'];
+        $params['company'] = config::operator[$refill_info['card_type']];
+        $params['sign'] = $this->sign($params);
+        $params = json_encode($params);
+
+        $resp = http_post_data(config::QUERY_URL, $params , 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'] == 200)
+            {
+                $status = intval($resp['data']['status']);
+                if ($status === 2) {
+                    $updata['official_sn'] = $resp['data']['ticketNo'];
+                    Model('refill_order')->edit($refill_info['order_id'], $updata);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status === 3) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($status, [0,1])) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['msg']];
+                }
+                return [true, $order_state];
+            }
+            else {
+                return [false, $resp['msg']];
+            }
+
+        }
+    }
+
+    private function sign($data)
+    {
+        $str = "";
+        ksort($data);
+        foreach($data as $k => $v){
+            if($this->check_empty($v) === false){
+                $str .= $v;
+            }
+        }
+        return md5($str.config::KEY);
+    }
+}

+ 3 - 0
helper/refill/api/xyz/fengye/api.txt

@@ -0,0 +1,3 @@
+后台:http://47.118.36.120/supplier/
+账号:yzdz02    
+密码:12345678

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

@@ -0,0 +1,21 @@
+<?php
+
+
+namespace refill\fengye;
+
+use mtopcard;
+class config
+{
+    const ORDER_URL = 'http://47.118.36.120:9009/prod-produce/api/provide';
+    const QUERY_URL = 'http://47.118.36.120:9009/prod-produce/api/query';
+
+    const USER_ID = '13';
+    const KEY = '2579695a64e30345e23fdb53aebb7b6c';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_fengye.php";
+    const ExtHeaders = ['Content-Type: application/json'];
+    const operator = [
+        mtopcard\ChinaMobileCard  => 'yd',
+        mtopcard\ChinaUnicomCard  => 'lt',
+        mtopcard\ChinaTelecomCard => 'dx'
+    ];
+}

+ 61 - 0
helper/refill/api/xyz/yichangt/RefillCallBack.php

@@ -0,0 +1,61 @@
+<?php
+namespace refill\yichangt;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yichangt/config.php');
+
+use refill;
+
+class RefillCallBack implements refill\IRefillCallBack
+{
+    public function verify($params): bool
+    {
+        $input = $params;
+        unset($input['signature']);
+        $input['token'] = sha1(config::APP_ID . '|' . config::APP_SECRET);
+        $sign = $this->sign($input);
+        if ($params['signature'] == $sign) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $signature_string = '';
+        foreach ($params as $k => $v) {
+            if (strlen($v)) {
+                $signature_string .= $k . '=' . $v . '&';
+            }
+        }
+        $signature_string = substr($signature_string, 0, -1);
+
+        return sha1($signature_string);
+    }
+
+
+    public function notify($params)
+    {
+        $status = intval($params['status']);
+        $order_sn = $params['merchant_order_id'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false,false];
+        }
+
+        $order_id = $order_info['order_id'];
+        if ($status === 2) {
+            $data['official_sn'] = strtolower($params['s_nubmer']) == 'null' ? '' : $params['s_nubmer'];
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false,true];
+        }
+        elseif ($status === 3) {
+            return [$order_id, false, false,true];
+        }
+        else {
+            return [$order_id, false, false,false];
+        }
+    }
+}

+ 117 - 0
helper/refill/api/xyz/yichangt/RefillOil.php

@@ -0,0 +1,117 @@
+<?php
+
+namespace refill\yichangt;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yichangt/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, string $order_sn, int $amount)
+    {
+        $params['appid'] = config::APP_ID;
+        $params['api_product'] = 'zshcz';
+        $params['order'] = $order_sn;
+        $params['cash'] = $amount;
+        $params['card'] = $card_no;
+        $params['nonce'] = rand(100000,999999);
+        $params['time'] = time();
+
+        $params['token'] = sha1(config::APP_ID . '|' . config::APP_SECRET);
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params)
+    {
+        $params = $this->req_params($card_no, $params['order_sn'], $amount);
+
+        $sign = $this->sign($params);
+        $params['signature'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params, 'POST');
+        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'] == 1) {
+                return [true, $resp['data']['order'], false];
+            } else {
+                return [false, $resp['info'], false];
+            }
+        }
+    }
+
+    public function query($refill_info)
+    {
+        $params['appid'] = config::APP_ID;
+        $params['api_product'] = 'query';
+        $params['merchant_order_id'] = $refill_info['order_sn'];
+        $params['nonce'] = rand(100000,999999);
+        $params['time'] = time();
+        $params['token'] = sha1(config::APP_ID . '|' . config::APP_SECRET);
+        $sign = $this->sign($params);
+        $params['signature'] = $sign;
+
+        $resp = http_request(config::QUERY_URL, $params, 'POST');
+        if (empty($resp)) {
+            return [false, '系统错误'];
+        }
+        else
+        {
+            Log::record($resp, Log::DEBUG);
+            $resp = json_decode($resp, true);
+            if (empty($resp))
+            {
+                return [false, '系统错误'];
+            }
+            elseif ($resp['code'] == 1)
+            {
+                $data = $resp['data'];
+                $status = $data['status'];
+                if ($status == 2) {
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($status == 3) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($status, [1,4])) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['info']];
+                }
+
+                return [true, $order_state];
+            }
+            else
+            {
+                return [false, $resp['info']];
+            }
+        }
+    }
+
+    private function sign($params)
+    {
+        ksort($params);
+
+        $signature_string = '';
+        foreach ($params as $k => $v) {
+            if (strlen($v)) {
+                $signature_string .= $k . '=' . $v . '&';
+            }
+        }
+        $signature_string = substr($signature_string, 0, -1);
+
+        return sha1($signature_string);
+    }
+}

+ 11 - 0
helper/refill/api/xyz/yichangt/config.php

@@ -0,0 +1,11 @@
+<?php
+namespace refill\yichangt;
+
+class config
+{
+    const ORDER_URL = 'http://youka.5dev.cn/gateway/api.handle/submit';
+    const QUERY_URL = 'http://youka.5dev.cn/gateway/api.handle/order';
+
+    const APP_ID = 'app570259129507';
+    const APP_SECRET = 'IQL4MOIYQJVWPJVOUM66H5MC7N8LGEE0';
+}

+ 8 - 0
helper/refill/api/xyz/yichangt/对接文档.txt

@@ -0,0 +1,8 @@
+app570259129507
+IQL4MOIYQJVWPJVOUM66H5MC7N8LGEE0
+
+˝ÓżÚľŘÖˇ http://www.docway.net/project/1boLpZGrDZR/1boLtvawci
+
+
+
+

+ 4 - 0
mobile/callback/refill_fengye.php

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

+ 4 - 0
mobile/callback/refill_yichangt.php

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

+ 20 - 0
test/TestRefill.php

@@ -559,6 +559,16 @@ class TestRefill extends TestCase
         refill\RefillFactory::instance()->notify('jumi',$input);
     }
 
+    public function testFengyePhone()
+    {
+        $providers = new refill\fengye\RefillPhone([]);
+//        $resp = $providers->add(18074608795, 6, 50, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '53511620355988978053', 'card_no' => 18074608795, 'card_type' => 6]);
+        $data = '{"amount":"50.00","orderNo":"53511620355988978053","supplierId":"13","orderId":"S20210507105309202749918513","notifyTime":"1620356062365","sign":"371260b007f2e64d86873ce3ede67fa3","discountAmount":"2.50","phoneNo":"18074608795","queryUrl":"https:\/\/www.189.cn\/client\/wap\/wapproject\/wapclient\/feecharge\/feecharge_result.html?sessionid=e896e66c2e134ba3b469b26df34d12d1","payType":"wechat","ticketNo":"1000000083421050710397228882","company":"dx","status":"2"}';
+        $input = json_decode($data, true);
+        refill\RefillFactory::instance()->notify('fengye',$input);
+    }
+
     public function testLuqianPhone()
     {
         $providers = new refill\luqian\RefillPhone([]);
@@ -704,6 +714,16 @@ class TestRefill extends TestCase
         $resp = $providers->add(1000111100020445281, mtopcard\SinopecCard, 100, ['order_sn' => $this->make_sn()]);
     }
 
+    public function testYichangtOil()
+    {
+        $providers = new refill\yichangt\RefillOil([]);
+        $resp = $providers->add(1000111100021211884, mtopcard\SinopecCard, 200, ['order_sn' => $this->make_sn()]);
+//        $resp = $providers->query(['order_sn' => '87591620379260314044']);
+        $data = '{"appid":"app570259129507","order_id":"M202105077888184428723706","merchant_order_id":"82231620378877155624","status":"3","cash":"100","time":"1620378961450","nonce":"2fad56d59a9f46d896c15b0cff74bc","signature":"57a6d24ec376b58bb433cfcf8528d53cb276eac8"}';
+        $input = json_decode($data, true);
+//        refill\RefillFactory::instance()->notify('yichangt',$input);
+    }
+
     public function testGFTDCB()
     {
         $data = '{"channelOrderNumber":"79091610959059372019","orderNumber":"GYFL1610959060397001","message":"充值成功","storage":"881036222bd8f067ff47d248c75f4c8d","voucher":"","status":101}';