瀏覽代碼

debug saihu api

stanley-king 4 年之前
父節點
當前提交
4c92717f41

+ 6 - 6
data/config/prod/refill.ini.php

@@ -31,12 +31,12 @@ $lx_oil = ['name' => 'lx', 'store_id' => 14, 'card_type' => ['sinopec'],
     ],
     ],
     'period' => ['start' => '14:00', 'end' => '17:55'],'official_sn' => true,'refill_type' => 'inner_store'];
     'period' => ['start' => '14:00', 'end' => '17:55'],'official_sn' => true,'refill_type' => 'inner_store'];
 
 
-$zz_oil = ['name' => 'zz', 'store_id' => 15, 'card_type' => ['sinopec'],
-    'amount' => [100 => ['goods_id' => 6313, 'price' => 98],
-        200 => ['goods_id' => 6314, 'price' => 196],
-        500 => ['goods_id' => 6315, 'price' => 490],
-        1000 => ['goods_id' => 6316, 'price' => 980],
-        2000 => ['goods_id' => 6317, 'price' => 1960]], 'refill_type' => 'api'];
+$saihu_oil = ['name' => 'saihu', 'store_id' => 15, 'card_type' => ['sinopec'],
+    'amount' => [100 => ['goods_id' => 6313, 'price' => 97],
+        200 => ['goods_id' => 6314, 'price' => 194],
+        500 => ['goods_id' => 6315, 'price' => 485],
+        1000 => ['goods_id' => 6316, 'price' => 970],
+        2000 => ['goods_id' => 6317, 'price' => 1940]], 'refill_type' => 'api'];
 
 
 //'zzx' => $zzx_oil,
 //'zzx' => $zzx_oil,
 //$oil_providers = ['suhc' => $suhc_oil, 'suhctm' => $suhctm_oil, 'lx' => $lx_oil];
 //$oil_providers = ['suhc' => $suhc_oil, 'suhctm' => $suhctm_oil, 'lx' => $lx_oil];

+ 4 - 0
helper/refill/RefillFactory.php

@@ -41,6 +41,10 @@ require_once(BASE_HELPER_PATH . '/refill/lx/RefillOil.php');
 require_once(BASE_HELPER_PATH . '/refill/lx/RefillPhone.php');
 require_once(BASE_HELPER_PATH . '/refill/lx/RefillPhone.php');
 require_once(BASE_HELPER_PATH . '/refill/lx/RefillCallBack.php');
 require_once(BASE_HELPER_PATH . '/refill/lx/RefillCallBack.php');
 
 
+require_once(BASE_HELPER_PATH . '/refill/saihu/RefillOil.php');
+require_once(BASE_HELPER_PATH . '/refill/saihu/RefillPhone.php');
+require_once(BASE_HELPER_PATH . '/refill/saihu/RefillCallBack.php');
+
 use Log;
 use Log;
 use mtopcard;
 use mtopcard;
 use QueueClient;
 use QueueClient;

+ 1 - 1
helper/refill/saihu/RefillOil.php

@@ -23,7 +23,7 @@ class RefillOil extends refill\IRefillOil
         $params['cardnum'] = $amount;
         $params['cardnum'] = $amount;
         $params['ordersn'] = $other['order_sn'];
         $params['ordersn'] = $other['order_sn'];
 
 
-        $params['backUrl'] = urlencode(config::NOTIFY_URL);
+//        $params['backUrl'] = urlencode(config::NOTIFY_URL);
         return $params;
         return $params;
     }
     }
 
 

+ 5 - 1
helper/refill/saihu/config.php

@@ -7,9 +7,13 @@ namespace refill\saihu;
 class config
 class config
 {
 {
     const ORDER_URL = 'https://qzcz.edusahoo.com.cn/api/sinopec/onlineorder';
     const ORDER_URL = 'https://qzcz.edusahoo.com.cn/api/sinopec/onlineorder';
+//    const APP_ID = '100001';
     const APP_ID = '0ceb5bc14dca15c4e5e53244d30b30bc';
     const APP_ID = '0ceb5bc14dca15c4e5e53244d30b30bc';
+//    const APP_ID = 'f0fc7208dab355e418b1b07f940da413';
+//    const APP_KEY = '03ed24aec631996fT0pVtw1tckzXhRy5KQHkIFtEIc9OBzg3F0RmWYFQ3F3AKzkKWqPAKPFzNFEdRkqkZudpsI';
+//    const APP_KEY = 'cf1897f043b4288e9qYtWjiZ7HKJDO20Q8CLLqn3CW4H37xKkEWJcOTXSM0FUSJ2oICysrI34ORanH04mXjA';
     const APP_KEY = '03ed24aec631996fT0pVtw1tckzXhRy5KQHkIFtEIc9OBzg3F0RmWYFQ3F3AKzkKWqPAKPFzNFEdRkqkZudpsI';
     const APP_KEY = '03ed24aec631996fT0pVtw1tckzXhRy5KQHkIFtEIc9OBzg3F0RmWYFQ3F3AKzkKWqPAKPFzNFEdRkqkZudpsI';
 
 
-    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_zz.php";
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/refill_saihu.php";
     const API_IP = NET_IP;
     const API_IP = NET_IP;
 }
 }

+ 1 - 1
mobile/refill_zz.php

@@ -2,7 +2,7 @@
 
 
 require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
 require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
 
 
-refill\RefillFactory::instance()->notify('zz',$_POST);
+refill\RefillFactory::instance()->notify('saihu',$_POST);
 
 
 echo ('success');
 echo ('success');
 
 

+ 3 - 7
test/TestRefill.php

@@ -14,8 +14,6 @@ require_once(BASE_CORE_PATH . '/framework/function/http.php');
 require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
 require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
 require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
 require_once(BASE_HELPER_PATH . '/mtopcard/mtopcard.php');
 
 
-require_once(BASE_HELPER_PATH . '/refill/zz/RefillOil.php');
-
 const LocalTest = 1;
 const LocalTest = 1;
 const NetTest = 2;
 const NetTest = 2;
 
 
@@ -84,13 +82,11 @@ class TestRefill extends TestCase
         }
         }
     }
     }
 
 
-    public function testzzOil()
+    public function testSaihuOil()
     {
     {
         global $config;
         global $config;
-        $providers = new \refill\zz\RefillOil($config['oil_providers']['zz']);
-        $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => '200229600551218886']);
-
-//        $ret = refill\RefillFactory::instance()->notify('beixt',$params);
+        $providers = new refill\saihu\RefillOil([]);
+        $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => $this->make_sn()]);
     }
     }
 
 
     public function testBdtOil()
     public function testBdtOil()