Pārlūkot izejas kodu

TestRefill 合并冲突

zhaoming 1 gadu atpakaļ
vecāks
revīzija
88e24378aa

+ 26 - 26
data/config/xyz/refill.ini.php

@@ -10143,44 +10143,44 @@ $weisanhuo_phone = ['name' => 'weisanhuo', 'store_id' => 384, 'qualitys' => '1',
 $yiqian_tax_phone = ['name' => 'yiqian_tax', 'store_id' => 385, 'qualitys' => '2',
 $yiqian_tax_phone = ['name' => 'yiqian_tax', 'store_id' => 385, 'qualitys' => '2',
     'amount' => [
     'amount' => [
 //        10 => [
 //        10 => [
-//            ['goods_id' => 9017, 'price' => 10.39, 'quality' => 2, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 9017, 'price' => 10.08, 'quality' => 2, 'card_type' => 'chinaunicom'],
-//            ['goods_id' => 9017, 'price' => 10.39, 'quality' => 2, 'card_type' => 'chinatelecom']
+//            ['goods_id' => 9017, 'price' => 10, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9017, 'price' => 10, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 9017, 'price' => 10, 'quality' => 2, 'card_type' => 'chinatelecom']
 //        ],
 //        ],
 //        20 => [
 //        20 => [
-//            ['goods_id' => 9018, 'price' => 20.46, 'quality' => 2, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 9018, 'price' => 20.16, 'quality' => 2, 'card_type' => 'chinaunicom'],
-//            ['goods_id' => 9018, 'price' => 20.46, 'quality' => 2, 'card_type' => 'chinatelecom']
+//            ['goods_id' => 9018, 'price' => 20, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9018, 'price' => 20, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 9018, 'price' => 20, 'quality' => 2, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 9019, 'price' => 30, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9019, 'price' => 30, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 9019, 'price' => 30, 'quality' => 2, 'card_type' => 'chinatelecom']
 //        ],
 //        ],
-        30 => [
-//            ['goods_id' => 9019, 'price' => 30.36, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 9019, 'price' => 29.985, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 9019, 'price' => 29.97, 'quality' => 2, 'card_type' => 'chinatelecom']
-        ],
         50 => [
         50 => [
-//            ['goods_id' => 9020, 'price' => 50.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 9020, 'price' => 49.975, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 9020, 'price' => 49.95, 'quality' => 2, 'card_type' => 'chinatelecom']
+//            ['goods_id' => 9020, 'price' => 50, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9020, 'price' => 50, 'quality' => 2, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 9020, 'price' => 50, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         100 => [
         100 => [
-            ['goods_id' => 9021, 'price' => 100.1, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 9021, 'price' => 99.95, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 9021, 'price' => 99.9, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 9021, 'price' => 100, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9021, 'price' => 100, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 9021, 'price' => 100, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         200 => [
         200 => [
-            ['goods_id' => 9022, 'price' => 200.2, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 9022, 'price' => 199.9, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 9022, 'price' => 199.8, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 9022, 'price' => 200, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9022, 'price' => 200, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 9022, 'price' => 200, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         300 => [
         300 => [
-            ['goods_id' => 9023, 'price' => 300.3, 'quality' => 2, 'card_type' => 'chinamobile'],
-            ['goods_id' => 9023, 'price' => 299.85, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 9023, 'price' => 299.7, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 9023, 'price' => 300, 'quality' => 2, 'card_type' => 'chinamobile'],
+            ['goods_id' => 9023, 'price' => 300, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 9023, 'price' => 300, 'quality' => 2, 'card_type' => 'chinatelecom']
         ],
         ],
         500 => [
         500 => [
-            ['goods_id' => 9024, 'price' => 500.5, 'quality' => 2, 'card_type' => 'chinamobile'],
-//            ['goods_id' => 9024, 'price' => 498.75, 'quality' => 2, 'card_type' => 'chinaunicom'],
-            ['goods_id' => 9024, 'price' => 499.5, 'quality' => 2, 'card_type' => 'chinatelecom']
+            ['goods_id' => 9024, 'price' => 500, 'quality' => 2, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 9024, 'price' => 500, 'quality' => 2, 'card_type' => 'chinaunicom'],
+            ['goods_id' => 9024, 'price' => 500, 'quality' => 2, 'card_type' => 'chinatelecom']
         ]
         ]
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];

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

@@ -7941,6 +7941,51 @@ $yezipczy_phone = ['name' => 'yezipczy', 'store_id' => 307, 'qualitys' => '1',
     ],
     ],
     'official_sn' => true, 'refill_type' => 'api'];
     'official_sn' => true, 'refill_type' => 'api'];
 
 
+$yzpuchong2_phone = ['name' => 'yzpuchong2', 'store_id' => 308, 'qualitys' => '1',
+    'amount' => [
+//        10 => [
+//            ['goods_id' => 8475, 'price' => 10.025, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8475, 'price' => 10.05, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8475, 'price' => 10.17, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        20 => [
+//            ['goods_id' => 8476, 'price' => 20.05, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8476, 'price' => 20.1, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8476, 'price' => 20.34, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        30 => [
+//            ['goods_id' => 8477, 'price' => 30, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8477, 'price' => 30.03, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8477, 'price' => 30.51, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+        50 => [
+            ['goods_id' => 8478, 'price' => 47.75, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8478, 'price' => 50, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8478, 'price' => 50, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        100 => [
+            ['goods_id' => 8479, 'price' => 95.5, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8479, 'price' => 100, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8479, 'price' => 100, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+        200 => [
+            ['goods_id' => 8480, 'price' => 191, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8480, 'price' => 200, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8480, 'price' => 200, 'quality' => 1, 'card_type' => 'chinatelecom']
+        ],
+//        300 => [
+//            ['goods_id' => 8481, 'price' => 300, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8481, 'price' => 300.3, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8481, 'price' => 300.3, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ],
+//        500 => [
+//            ['goods_id' => 8482, 'price' => 500, 'quality' => 1, 'card_type' => 'chinamobile'],
+//            ['goods_id' => 8482, 'price' => 500.5, 'quality' => 1, 'card_type' => 'chinaunicom'],
+//            ['goods_id' => 8482, 'price' => 500.5, 'quality' => 1, 'card_type' => 'chinatelecom']
+//        ]
+    ],
+    'official_sn' => true, 'refill_type' => 'api'];
+
 $phone_providers = [
 $phone_providers = [
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'beixt', 'cfg' => $beixt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
 //    ['name' => 'bxtwt', 'cfg' => $bxtwt_phone],
@@ -8195,6 +8240,7 @@ $phone_providers = [
     ['name' => 'liantuo_nation_trd', 'cfg' => $liantuo_nation_trd_phone],
     ['name' => 'liantuo_nation_trd', 'cfg' => $liantuo_nation_trd_phone],
     ['name' => 'beirui_trd', 'cfg' => $beirui_trd_phone],
     ['name' => 'beirui_trd', 'cfg' => $beirui_trd_phone],
     ['name' => 'yezipczy', 'cfg' => $yezipczy_phone],
     ['name' => 'yezipczy', 'cfg' => $yezipczy_phone],
+    ['name' => 'yzpuchong2', 'cfg' => $yzpuchong2_phone],
 ];
 ];
 
 
 $config['phone_providers'] = $phone_providers;
 $config['phone_providers'] = $phone_providers;

+ 18 - 2
helper/refill/api/xyz/yiqian_tax/API.MD

@@ -1,6 +1,6 @@
 
 
 ## 壹仟含税
 ## 壹仟含税
-
+> copy from dashang
 - 用户编号(userId): 261
 - 用户编号(userId): 261
 - 密钥(privateKey):c739d5f68333deaeb6ae04d30e60e836896587968219656fcf66c1708c76f9d7
 - 密钥(privateKey):c739d5f68333deaeb6ae04d30e60e836896587968219656fcf66c1708c76f9d7
 
 
@@ -15,4 +15,20 @@
 
 
 ## 店铺
 ## 店铺
 - 账号:yiqian_tax
 - 账号:yiqian_tax
-- 密码:yiqian_tax67890
+- 密码:yiqian_tax67890
+## 产品编码
+### 移动
+- 100:10000
+- 200:10005
+- 300:10006
+- 500:10007
+### 联通
+- 50:10011
+- 100:10012
+- 200:10013
+- 300:10014
+### 电信
+- 100:10020
+- 200:10021
+- 300:10022
+- 500:10023

+ 0 - 3
helper/refill/api/xyz/yiqian_tax/RefillCallBack.php

@@ -37,10 +37,7 @@ class RefillCallBack implements refill\IRefillCallBack
 
 
         if ($status === 2) {
         if ($status === 2) {
             $official_sn = strtolower($params['voucher']) == 'null' ? '' : $params['voucher'];
             $official_sn = strtolower($params['voucher']) == 'null' ? '' : $params['voucher'];
-            $ch_trade_no = $params['ejId'];
-
             $data['official_sn'] = $official_sn;
             $data['official_sn'] = $official_sn;
-            $data['ch_trade_no'] = $ch_trade_no;
             Model('refill_order')->edit($order_id, $data);
             Model('refill_order')->edit($order_id, $data);
             return [$order_id, true, false, true, $official_sn];
             return [$order_id, true, false, true, $official_sn];
         }
         }

+ 2 - 3
helper/refill/api/xyz/yiqian_tax/RefillPhone.php

@@ -68,7 +68,7 @@ class RefillPhone extends refill\IRefillPhone
         $params['userId'] = config::USER_ID;
         $params['userId'] = config::USER_ID;
         $params['serialno'] = $refill_info['order_sn'];
         $params['serialno'] = $refill_info['order_sn'];
         $key = config::KEY;
         $key = config::KEY;
-        $content = "{$params['userId']}{$params['serialno']}{$key}";
+        $content = "{$params['serialno']}{$params['userId']}{$key}";
         $params['sign'] = md5($content);
         $params['sign'] = md5($content);
 
 
         $resp = http_request(config::QUERY_URL, $params);
         $resp = http_request(config::QUERY_URL, $params);
@@ -99,8 +99,7 @@ class RefillPhone extends refill\IRefillPhone
                     $status = intval($resp['data']['status']);
                     $status = intval($resp['data']['status']);
                     if ($status === 2) {
                     if ($status === 2) {
                         $official_sn = $resp['data']['outOrderNo'];
                         $official_sn = $resp['data']['outOrderNo'];
-                        $ch_trade_no = $resp['data']['id'];
-                        Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $official_sn,'ch_trade_no' => $ch_trade_no]);
+                        Model('refill_order')->edit($refill_info['order_id'], ['official_sn' => $official_sn]);
                         $order_state = ORDER_STATE_SUCCESS;
                         $order_state = ORDER_STATE_SUCCESS;
                     } elseif ($status === 3) {
                     } elseif ($status === 3) {
                         $order_state = ORDER_STATE_CANCEL;
                         $order_state = ORDER_STATE_CANCEL;

+ 12 - 24
helper/refill/api/xyz/yiqian_tax/config.php

@@ -18,36 +18,24 @@ class config
     const Products = [
     const Products = [
         mtopcard\ChinaMobileCard =>
         mtopcard\ChinaMobileCard =>
             [
             [
-                10  => 90440010,
-                20  => 90440020,
-                30  => 90440030,
-                50  => 90440050,
-                100 => 90440100,
-                200 => 90440200,
-                300 => 90440300,
-                500 => 90440500
+                100 => 10000,
+                200 => 10005,
+                300 => 10006,
+                500 => 10007
             ],
             ],
         mtopcard\ChinaUnicomCard =>
         mtopcard\ChinaUnicomCard =>
             [
             [
-                10  => 90460010,
-                20  => 90460020,
-                30  => 90460030,
-                50  => 90460050,
-                100 => 90460100,
-                200 => 90460200,
-                300 => 90460300,
-                500 => 90460500
+                50  => 10011,
+                100 => 10012,
+                200 => 10013,
+                300 => 10014
             ],
             ],
         mtopcard\ChinaTelecomCard =>
         mtopcard\ChinaTelecomCard =>
             [
             [
-                10  => 90290010,
-                20  => 90290020,
-                30  => 90290030,
-                50  => 90290050,
-                100 => 90290100,
-                200 => 90290200,
-                300 => 90290300,
-                500 => 90290500
+                100 => 10020,
+                200 => 10021,
+                300 => 10022,
+                500 => 10023
             ]
             ]
     ];
     ];
 }
 }

+ 14 - 0
helper/refill/api/yl/yzpuchong2/API.MD

@@ -0,0 +1,14 @@
+### 椰子普充专用2号
+- 接口地址:https://admin.xyzshops.cn/merchant/#/login
+
+### 机构账号
+- yzpuchong2
+- shi_ci34
+- 10498
+
+### 店铺账号
+- yzpuchong2
+- yzpuchong27890
+- 
+### 密钥
+e863a31f04c437ee016ed4058ebcf8f7

+ 76 - 0
helper/refill/api/yl/yzpuchong2/RefillCallBack.php

@@ -0,0 +1,76 @@
+<?php
+namespace refill\yzpuchong2;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yzpuchong2/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): bool
+    {
+        if (!isset($value))
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params): string
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+        return md5($body);
+    }
+
+    public function notify($params): array
+    {
+        $status = $params['state'];
+        $order_sn = $params['order_sn'];
+        $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
+        if (empty($order_info)) {
+            return [false, false, false, false, ''];
+        }
+        $official_sn = strtolower($params['official_sn']) == 'null' ? '' : $params['official_sn'];
+
+        $order_id = $order_info['order_id'];
+        if ($status === 'SUCCESS') {
+            $data['ch_trade_no'] = $params['trade_no'];
+            $data['official_sn'] = $official_sn;
+            Model('refill_order')->edit($order_id, $data);
+            return [$order_id, true, false, true, $official_sn];
+        }
+        elseif ($status === 'CANCEL') {
+            Model('refill_order')->edit($order_id, ['ch_trade_no' => $params['trade_no']]);
+            return [$order_id, false, true, true, ''];
+        }
+        else {
+            return [$order_id, false, false, false, ''];
+        }
+    }
+}

+ 161 - 0
helper/refill/api/yl/yzpuchong2/RefillPhone.php

@@ -0,0 +1,161 @@
+<?php
+
+namespace refill\yzpuchong2;
+
+require_once(BASE_HELPER_RAPI_PATH . '/yzpuchong2/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, string $order_sn): array
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'add';
+        $params['mchid'] = config::MCH_ID;
+        $params['cardno'] = $phone;
+        $params['amount'] = $amount;
+        $params['order_sn'] = $order_sn;
+        $params['notifyurl'] = config::NOTIFY_URL;
+        return $params;
+    }
+
+    public function add($card_no, $card_type, $amount, $params, &$net_errno = 0): array
+    {
+        $params = $this->req_params($card_no, $amount, $params['order_sn']);
+        $sign = $this->sign($params);
+        $params['sign'] = $sign;
+
+        $resp = http_request(config::ORDER_URL, $params , 'POST' , false , [] , $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['act'] = 'refill';
+        $params['op'] = 'query';
+        $params['mchid'] = config::MCH_ID;
+        $params['order_sn'] = $refill_info['order_sn'];
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_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'] === 200)
+            {
+                $official_sn = strtolower($resp['official_sn']) == 'null' ? '' : $resp['official_sn'];
+
+                $data = $resp['datas'];
+                if ($data['order_state'] == '40') {
+                    $save['ch_trade_no'] = $data['trade_no'];
+                    $save['official_sn'] = $official_sn;
+                    Model('refill_order')->edit($refill_info['order_id'], $save);
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($data['order_state'] === '0') {
+                    Model('refill_order')->edit($refill_info['order_id'], ['ch_trade_no' => $data['trade_no']]);
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif (in_array($data['order_state'], ['10', '20', '30', '50'], true)) {
+                    $order_state = ORDER_STATE_SEND;
+                } else {
+                    return [false, $resp['message'], ''];
+                }
+                return [true, $order_state, $official_sn];
+            }
+            elseif ($resp['code'] === 202 && (time() - $refill_info['commit_time'] >= 600))
+            {
+                return [true, ORDER_STATE_NOEXIST, ''];
+            }
+            else
+            {
+                return [false, $resp['message'], ''];
+            }
+        }
+    }
+
+    public function balance(): array
+    {
+        $params['act'] = 'refill';
+        $params['op'] = 'balance';
+        $params['mchid'] = config::MCH_ID;
+        $params['sign'] = $this->sign($params);
+
+        $resp = http_request(config::ORDER_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'] === 200) {
+                return [true, ncPriceFormat($resp['datas']['balance'])];
+            } else {
+                return [false, $resp['message']];
+            }
+        }
+    }
+
+    protected function check_empty($value): bool
+    {
+        if (!isset($value))
+            return true;
+        if (trim($value) === "")
+            return true;
+
+        return false;
+    }
+
+    private function sign($params): string
+    {
+        ksort($params);
+
+        $body = "";
+        $i = 0;
+        foreach ($params as $k => $v) {
+            if (false === $this->check_empty($v) && "@" != substr($v, 0, 1)) {
+                if ($i == 0) {
+                    $body .= "{$k}" . "=" . urlencode($v);
+                } else {
+                    $body .= "&" . "{$k}" . "=" . urlencode($v);
+                }
+                $i++;
+            }
+        }
+
+        $body .= "&key=".config::KEY;
+
+        return md5($body);
+    }
+}

+ 13 - 0
helper/refill/api/yl/yzpuchong2/config.php

@@ -0,0 +1,13 @@
+<?php
+
+namespace refill\yzpuchong2;
+
+class config
+{
+    const ORDER_URL = 'https://www.xyzshops.cn/mobile/index.php';
+
+    const MCH_ID = 10498;
+    const KEY = 'e863a31f04c437ee016ed4058ebcf8f7';
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_yzpuchong2.php";
+
+}

+ 4 - 0
mobile/callback/refill_yzpuchong2.php

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

+ 10 - 4
test/TestRefill.php

@@ -5828,8 +5828,8 @@ class TestRefill extends TestCase
     {
     {
         $provider = $this->getProvider('yiqian_tax');
         $provider = $this->getProvider('yiqian_tax');
         $resp = $provider->balance();
         $resp = $provider->balance();
-//        $resp = $provider->add(13699279618, 4, 50, ['order_sn' => $this->make_sn()]);
-//        $resp = $provider->query(['order_sn' => '24271700815859899563']);
+        $resp = $provider->add(13699279618, 4, 100, ['order_sn' => $this->make_sn()]);
+        $resp = $provider->query(['order_sn' => '56641701227303096134']);
     }
     }
 
 
     public function testmiaoxt_fs_three()
     public function testmiaoxt_fs_three()
@@ -5840,8 +5840,7 @@ class TestRefill extends TestCase
 
 
     public function testkainuo60_official_sn()
     public function testkainuo60_official_sn()
     {
     {
-        $extractOfficialSn = function ($officialSnStr)
-        {
+        $extractOfficialSn = function ($officialSnStr) {
             $officialSnStr = trim($officialSnStr);
             $officialSnStr = trim($officialSnStr);
 
 
             if (strtolower($officialSnStr) == 'null') {
             if (strtolower($officialSnStr) == 'null') {
@@ -5853,6 +5852,7 @@ class TestRefill extends TestCase
             return '';
             return '';
         };
         };
 
 
+
         $s0 = $extractOfficialSn('');
         $s0 = $extractOfficialSn('');
         $s1 = $extractOfficialSn('缴费成功__');
         $s1 = $extractOfficialSn('缴费成功__');
         $s3 = $extractOfficialSn('ZT20231129192955657301');
         $s3 = $extractOfficialSn('ZT20231129192955657301');
@@ -5861,6 +5861,12 @@ class TestRefill extends TestCase
         $s6 = $extractOfficialSn('594043620012941162');
         $s6 = $extractOfficialSn('594043620012941162');
         $s7 = $extractOfficialSn('GZV02311303763808458');
         $s7 = $extractOfficialSn('GZV02311303763808458');
     }
     }
+
+    public function testyzpuchong2()
+    {
+        $provider = $this->getProvider('yzpuchong2');
+        $resp = $provider->balance();
+    }
 }
 }