Browse Source

yl linzhu

xiaoyu 3 years atrás
parent
commit
179e6429a0

+ 1 - 19
helper/refill/api/yl/linzhu/RefillCallBack.php

@@ -7,25 +7,7 @@ class RefillCallBack implements refill\IRefillCallBack
 {
     public function verify($params): bool
     {
-        $sign = $this->sign($params);
-        if ($params['sign'] == $sign) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    private function sign($params)
-    {
-        $data['account'] = $params['account'];
-        $data['timestamp'] = $params['timestamp'];
-        $data['secret'] = config::KEY;
-        asort($data);
-        $content = '';
-        foreach ($data as $val){
-            $content .= $val;
-        }
-        return sha1($content);
+       return true;
     }
 
     public function notify($params)

+ 3 - 3
helper/refill/api/yl/linzhu/RefillPhone.php

@@ -85,11 +85,11 @@ class RefillPhone extends refill\IRefillPhone
             {
                 if ($status === '026')
                 {
-                    //注意:在提交订单3分钟后,并且在3小时内发起的查询,返回该状态码可以处理为充值失败,不到3分钟或者3小时后发起的查询返回该状态处理为充值中。
+                    //订单不存在状态,三小时内查询可失败,超过则返回充值中.不可以在下单后的同时立马发起查询,否则返回该状态处理为充值中,至少隔30秒以上再发起查询
                     $commit_secs = time() - $refill_info['commit_time'];
-                    if ($commit_secs > 0 && $commit_secs <= 180) {
+                    if ($commit_secs > 0 && $commit_secs < 30) {
                         return [false, '时长不足'];
-                    } elseif ($commit_secs > 180 && $commit_secs < 10800) {
+                    } elseif ($commit_secs <= 10800 && $commit_secs >= 30) {
                         $order_state = ORDER_STATE_NOEXIST;
                     } else {
                         $order_state = ORDER_STATE_SEND;

+ 3 - 3
helper/refill/api/yl/linzhu/config.php

@@ -7,9 +7,9 @@ use mtopcard;
 class config
 {
     //回调地址需配置
-    const ORDER_URL = 'http://47.108.202.150/flow-receiver/fee/v3/recharge';
-    const QUERY_URL = 'http://47.108.202.150/flow-receiver/fee/v3/query/single';
-    const BALANCE_URL = 'http://47.108.202.150/flow-receiver/fee/v3/balance/query';
+    const ORDER_URL = 'http://47.108.202.150/flow-receiver/fee/recharge';
+    const QUERY_URL = 'http://47.108.202.150/flow-receiver/fee/query/single';
+    const BALANCE_URL = 'http://47.108.202.150/flow-receiver/fee/balance/query';
     const NOTIFY_URL = BASE_SITE_URL . '/mobile/callback/refill_linzhu.php';
     const ACCOUNT = 'yelin';
     const KEY = '3f89f248c87944f58916088e56c1cb5c';

+ 3 - 3
helper/refill/api/yl/linzhu/椰子.txt

@@ -4,11 +4,11 @@ http://47.108.202.150/flow-consumer/login.html
 密钥 3f89f248c87944f58916088e56c1cb5c
 
 下单地址
-http://47.108.202.150/flow-receiver/fee/v3/recharge
+http://47.108.202.150/flow-receiver/fee/recharge
 查询地址
-http://47.108.202.150/flow-receiver/fee/v3/query/single
+http://47.108.202.150/flow-receiver/fee/query/single
 余额查询地址
-http://47.108.202.150/flow-receiver/fee/v3/balance/query
+http://47.108.202.150/flow-receiver/fee/balance/query
 
 移动快充产品编码  面值
 CMCCALLr30r    30

File diff suppressed because it is too large
+ 3 - 0
helper/refill/api/yl/linzhu/话费充值接口v1.1.doc


File diff suppressed because it is too large
+ 0 - 3
helper/refill/api/yl/linzhu/话费充值接口v3.doc


+ 7 - 7
test/TestRefillYl.php

@@ -168,16 +168,16 @@ class TestRefillYl extends TestCase
 
     public function testLinzhu()
     {
-        $provider = $this->getProvider('linzhu');
+//        $provider = $this->getProvider('linzhu');
 //        $resp = $provider->balance();
 //        $resp = $provider->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
-        $resp = $provider->query(['order_sn' => '2908530702227825886329']);
+//        $resp = $provider->query(['order_sn' => '84391648889914218946']);
 
-//        $body = '{"sign":"dda018201e27ea8a245af086a4ef789798fbcb8b","timestamp":"20220402151909","orderNo":"F2204021517247713292","status":"003","consumerNo":"0731990702227843968489","account":"yelin","voucherNo":null,"mobile":"17764429022"}';
-//        $params = json_decode($body, true);
-//        $provider = $this->getProvider('linzhu', 'RefillCallBack');
-//        $ret = $provider->verify($params);
-//        $data = $provider->notify($params);
+        $body = '{"orderNo":"F2204021658518549406","status":"003","consumerNo":"84391648889914218946","voucherNo":null,"mobile":"18500608333"}';
+        $params = json_decode($body, true);
+        $provider = $this->getProvider('linzhu', 'RefillCallBack');
+        $ret = $provider->verify($params);
+        $data = $provider->notify($params);
     }
 
     public function testRuixunda()