xiaoyu il y a 1 an
Parent
commit
d262446c40

+ 3 - 3
helper/refill/api/xyz/oufei/RefillOil.php

@@ -14,7 +14,7 @@ class RefillOil extends refill\IRefillPhone
         parent::__construct($cfgs);
     }
 
-    private function req_params(int $phone, int $amount, int $card_type, string $order_sn)
+    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);
@@ -22,7 +22,7 @@ class RefillOil extends refill\IRefillPhone
         $params['buyNum'] = 1;
         $params['spOrderId'] = $order_sn;
         $params['orderTime'] = date("YmdHis");
-        $params['customerNo'] = $phone;
+        $params['customerNo'] = $card_no;
         $params['retUrl'] = config::NOTIFY_URL;
         $params['version'] = '6.0';
         return $params;
@@ -101,7 +101,7 @@ class RefillOil extends refill\IRefillPhone
                 }
                 return [true, $order_state];
             }
-            elseif ($resp['retcode'] === '1010' && (time() - $refill_info['commit_time'] > 300))
+            elseif ($resp['retcode'] === '1010' && (time() - $refill_info['commit_time'] > 600))
             {
                 return [true, ORDER_STATE_NOEXIST];
             }

+ 14 - 0
helper/refill/api/xyz/oufei/api.txt

@@ -8,3 +8,17 @@ keystr:736E75E8BD6A943B
 加油卡直充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

+ 14 - 13
helper/refill/api/xyz/oufei/config.php

@@ -6,21 +6,14 @@ namespace refill\oufei;
 use mtopcard;
 class config
 {
-    const ORDER_URL = 'http://apitest.ofpay.com/newOnlineOrder.do';
-    const QUERY_URL= 'http://apitest.ofpay.com/queryOrderInfo.do';
-    const BALANCE_URL = 'http://apitest.ofpay.com/newqueryuserinfo.do';
+    const ORDER_URL = 'https://api2.ofpay.com/newOnlineOrder.do';
+    const QUERY_URL= 'https://api2.ofpay.com/queryOrderInfo.do';
+    const BALANCE_URL = 'https://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_oufei.php";
-    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
-
-    const operator = [
-        mtopcard\ChinaMobileCard  => 1,
-        mtopcard\ChinaUnicomCard  => 2,
-        mtopcard\ChinaTelecomCard => 3
-    ];
+    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_oufei.php";
     const ExtHeaders = ['Content-Type:application/x-www-form-urlencoded;charset=utf-8'];
 
     const ERR_NOS = [
@@ -29,10 +22,18 @@ class config
 
     const Product = [
         mtopcard\PetroChinaCard => [
-            200 => 64157003,
+            50 => 64349107,
+            100 => 64349106,
+            200 => 64349105,
+            500 => 64349103,
+            1000 => 64349101,
         ],
         mtopcard\SinopecCard => [
-            200 => 2000200,
+            50 => 64313605,
+            100 => 64157004,
+            200 => 64157003,
+            500 => 64157002,
+            1000 => 64157001,
         ],
     ];
 }

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


+ 4 - 0
mobile/callback/refill_oufei.php

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