stanley-king 4 年之前
父节点
当前提交
47d11ee7f3
共有 3 个文件被更改,包括 13 次插入15 次删除
  1. 0 4
      helper/refill/RefillFactory.php
  2. 5 6
      test/TestRBridge.php
  3. 8 5
      test/TestRefill.php

+ 0 - 4
helper/refill/RefillFactory.php

@@ -194,10 +194,6 @@ class RefillFactory
 
 
     public function notify($chname, $input)
     public function notify($chname, $input)
     {
     {
-        if (!in_array($chname, $this->mProviderNames)) {
-            return false;
-        }
-
         try
         try
         {
         {
             $class_name = "refill\\{$chname}\\RefillCallBack";
             $class_name = "refill\\{$chname}\\RefillCallBack";

+ 5 - 6
test/TestRBridge.php

@@ -49,29 +49,28 @@ class TestRBridge extends TestCase
 
 
     public function testWSDAdd()
     public function testWSDAdd()
     {
     {
-
         $resp = http_post_data(BASE_SITE_URL . "/mobile/bridge_shr.php",json_encode($this->getParams()),['Content-Type: application/json']);
         $resp = http_post_data(BASE_SITE_URL . "/mobile/bridge_shr.php",json_encode($this->getParams()),['Content-Type: application/json']);
     }
     }
 
 
     public function testTCPAdd()
     public function testTCPAdd()
     {
     {
         $params = $this->getParams();
         $params = $this->getParams();
-        $this->send(json_encode($params));
-
-
+        $resp = $this->send('121.89.223.81',json_encode($params));
     }
     }
 
 
-    public function send($body)
+    public function send($host,$body)
     {
     {
         global $config;
         global $config;
         $port = $config['wsd_bradge_port'];
         $port = $config['wsd_bradge_port'];
 
 
         $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
         $sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
-        if(socket_connect($sock, "192.168.1.220", $port))
+        if(socket_connect($sock, $host, $port))
         {
         {
             socket_write($sock,$body);
             socket_write($sock,$body);
             $resp = socket_read($sock,1024);
             $resp = socket_read($sock,1024);
+            return $resp;
         }
         }
+        return false;
     }
     }
 
 
     public function testSurAdd()
     public function testSurAdd()

+ 8 - 5
test/TestRefill.php

@@ -102,6 +102,12 @@ class TestRefill extends TestCase
 //        $ret = refill\RefillFactory::instance()->notify('beixt',$params);
 //        $ret = refill\RefillFactory::instance()->notify('beixt',$params);
     }
     }
 
 
+    public function testBxtwtCB()
+    {
+        $data = '{"order_number":18219726,"shipping_status":4,"shipping_status_desc":"发货失败","shipping_status_message":"","sign":"863b4d972f2a4d39a9af7396879116c4","voucher":"","vouchertype":"","voucherurl":"","tradeNo":"100662475851197741"}';
+
+    }
+
     public function testSuhcJDVerify()
     public function testSuhcJDVerify()
     {
     {
         $data = 'onlystr=920661883198026632&sign=533151e3f0dff5f507786aabc37b18f7&amt=100&notifyurl=https%3A%2F%2Fwww.xyzshops.cn%2Fmobile%2Frefill_suhc.php&jdno&cardtype=Sinoepc&batchid=26106&cardno=1000111100020654226&orgid=1590993600&status=3';
         $data = 'onlystr=920661883198026632&sign=533151e3f0dff5f507786aabc37b18f7&amt=100&notifyurl=https%3A%2F%2Fwww.xyzshops.cn%2Fmobile%2Frefill_suhc.php&jdno&cardtype=Sinoepc&batchid=26106&cardno=1000111100020654226&orgid=1590993600&status=3';
@@ -119,12 +125,9 @@ class TestRefill extends TestCase
 
 
     public function testBeixtVerify()
     public function testBeixtVerify()
     {
     {
-        $data = '{"order_number":17434573,"shipping_status":4,"shipping_status_desc":"发货失败","shipping_status_message":"","sign":"3d3b92fc5e30354fc05acf6b7225f699","voucher":"501373971049867026","vouchertype":"","voucherurl":"","tradeNo":"470661991563932741"}';
-        $url = "http://192.168.1.220/mobile/refill_bxtwt.php?xxx=yyy";
-//        $url = "http://192.168.1.220/mobile/refill_bxtwt.php";
-//        $url = "https://www.xyzshops.cn/mobile/refill_bxtwt.php";
+        $data = '{"order_number":18219726,"shipping_status":4,"shipping_status_desc":"发货失败","shipping_status_message":"","sign":"863b4d972f2a4d39a9af7396879116c4","voucher":"","vouchertype":"","voucherurl":"","tradeNo":"100662475851197741"}';
+        $url = "https://www.xyzshops.cn/mobile/refill_bxtwt.php";
 
 
-//        $resp = http_post_data($url,$data,['']);
         $headers = ['Content-Type: application/json'];
         $headers = ['Content-Type: application/json'];
         $resp = http_post_data($url,$data,$headers);
         $resp = http_post_data($url,$data,$headers);
     }
     }