xiaoyu 3 سال پیش
والد
کامیت
8e58d1f43f

+ 1 - 1
data/config/yl/refill.ini.php

@@ -5415,7 +5415,7 @@ $phone_providers = [
 //    ['name' => 'dinghui', 'cfg' => $dinghui_phone],
 //    ['name' => 'xiaoniu_hf', 'cfg' => $xiaoniu_hf_phone],
 //    ['name' => 'shuoruan', 'cfg' => $shuoruan_phone],
-//    ['name' => 'linzhu', 'cfg' => $linzhu_phone],
+    ['name' => 'linzhu', 'cfg' => $linzhu_phone],
 //    ['name' => 'huafutongman', 'cfg' => $huafutongman_phone],
 //    ['name' => 'feimingyu', 'cfg' => $feimingyu_phone],
 //    ['name' => 'dashang_normal', 'cfg' => $dashang_normal_phone],

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

@@ -7,7 +7,25 @@ class RefillCallBack implements refill\IRefillCallBack
 {
     public function verify($params): bool
     {
-       return true;
+        $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);
     }
 
     public function notify($params)

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

@@ -1,4 +1,6 @@
+http://47.108.202.150/flow-consumer/login.html
 账号 yelin
+密码 123456
 密钥 3f89f248c87944f58916088e56c1cb5c
 
 下单地址

+ 8 - 2
test/TestRefill.php

@@ -2059,10 +2059,16 @@ class TestRefill extends TestCase
 
     public function testYouheman()
     {
-        $provider = $this->getProvider('youheman');
+//        $provider = $this->getProvider('youheman');
 //        $resp = $provider->balance();
 //        $resp = $provider->add(18500608333, 5, 100, ['order_sn' => $this->make_sn()]);
-        $resp = $provider->query(['order_sn' => '65891648444382784227']);
+//        $resp = $provider->query(['order_sn' => '65891648444382784227']);
+
+        $body = '{"szOrderId":"65891648444382784227","fSalePrice":"91.5","szAgentId":"200040","nFlag":"2","szVerifyString":"899758ef408c86164529a3724806d52b","szPhoneNum":"18500608333","szRtnMsg":"OM1508468825220870144","nDemo":"100"}';
+        $params = json_decode($body, true);
+        $provider = $this->getProvider('youheman','RefillCallBack');
+        $ret = $provider->verify($params);
+        $resp = $provider->notify($params);
     }
 
     public function testAmingjd()

+ 8 - 8
test/TestRefillYl.php

@@ -168,16 +168,16 @@ class TestRefillYl extends TestCase
 
     public function testLinzhu()
     {
-        $provider = $this->getProvider('linzhu');
-        $resp = $provider->balance();
+//        $provider = $this->getProvider('linzhu');
+//        $resp = $provider->balance();
 //        $resp = $provider->add(18500608333, 5, 30, ['order_sn' => $this->make_sn()]);
-//        $resp = $provider->query(['order_sn' => '43881634986696312260']);
+//        $resp = $provider->query(['order_sn' => '71081648522867327868']);
 
-//        $body = '{"orderNo":"F2110231858443112627","status":"019","consumerNo":"43881634986696312260","voucherNo":null,"mobile":"18500608333"}';
-//        $params = json_decode($body, true);
-//        $provider = $this->getProvider('linzhu', 'RefillCallBack');
-//        $ret = $provider->verify($params);
-//        $data = $provider->notify($params);
+        $body = '{"sign":"83fe70f514600e05348a2c655ab085674dfa6153","timestamp":"20220329112433","orderNo":"F2203291124306519238","status":"003","consumerNo":"42761648524235437895","account":"yelin","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()