Bladeren bron

xunao provider update

HARUHARU 4 jaren geleden
bovenliggende
commit
77b6af93ff

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

@@ -593,6 +593,19 @@ $suyuan_phone = ['name' => 'suyuan', 'store_id' => 39, 'qualitys' => '1',
     ],
     'official_sn' => true, 'refill_type' => 'api'];
 
+$xunao_phone = ['name' => 'xunao', 'store_id' => 44, 'qualitys' => '1',
+    'amount' => [
+        10 => [['goods_id' => 6504, 'price' => 9.45, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        20 => [['goods_id' => 6505, 'price' => 18.9, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        30 => [['goods_id' => 6506, 'price' => 28.35, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        50 => [['goods_id' => 6507, 'price' => 47.25, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        100 => [['goods_id' => 6508, 'price' => 94.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        200 => [['goods_id' => 6509, 'price' => 189, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        300 => [['goods_id' => 6510, 'price' => 283.5, 'quality' => 1, 'card_type' => 'chinamobile,chinaunicom,chinatelecom']],
+        500 => [['goods_id' => 6511, '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],
@@ -618,5 +631,6 @@ $phone_providers = [
     ['name' => 'afandfs', 'cfg' => $afandfs_phone],
     ['name' => 'yunlingfs', 'cfg' => $yunlingfs_phone],
     ['name' => 'tiancheng', 'cfg' => $tiancheng_phone],
+    ['name' => 'xunao', 'cfg' => $xunao_phone],
 ];
 $config['phone_providers'] = $phone_providers;

+ 1 - 1
helper/fcgisrv/MobileServer.php

@@ -59,7 +59,7 @@ class MobileServer extends BaseServer
             'refill_weiyi.php','refill_tonglu.php','refill_xc.php','refill_xunyin.php',
             'refill_yunling.php','refill_wantong.php','refill_zhongst.php',
             'refill_luqian.php','refill_afandfs.php','refill_yunlingfs.php',
-            'refill_tiancheng.php'
+            'refill_tiancheng.php','refill_xunao.php'
         ];
 
         $this->setExFiles($exfiles);

+ 15 - 2
helper/refill/api/xyz/xunao/RefillCallBack.php

@@ -21,13 +21,26 @@ class RefillCallBack implements refill\IRefillCallBack
         }
     }
 
+    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($v){
-                $str .= urldecode($v);
+            if($this->check_empty($v) === false){
+                $str .= $v;
             }
         }
         return md5($str.config::KEY);

+ 1 - 2
helper/refill/api/xyz/xunao/config.php

@@ -11,8 +11,7 @@ class config
 
     const USER_ID = '10';
     const KEY = 'e4aa17f34d5ef57271b3fce13d938185';
-//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_xunao.php";
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_xunao.php";
     const ExtHeaders = ['Content-Type: application/json'];
     const operator = [
         mtopcard\ChinaMobileCard  => 'yd',

+ 4 - 0
mobile/refill_xunao.php

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