Parcourir la source

add CURLOPT_HTTP09_ALLOWED

stanley-king il y a 4 ans
Parent
commit
5a1c74814e
2 fichiers modifiés avec 18 ajouts et 0 suppressions
  1. 1 0
      core/framework/function/http.php
  2. 17 0
      test/TestRefill.php

+ 1 - 0
core/framework/function/http.php

@@ -89,6 +89,7 @@ function http_post_data($url, $body, $headers = array())
     curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);
     curl_setopt($ci, CURLOPT_URL, $url);
     curl_setopt($ci, CURLOPT_POST, TRUE);
+    curl_setopt($ci, CURLOPT_HTTP09_ALLOWED, TRUE);
 
     if (!empty($headers)) {
         curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);

+ 17 - 0
test/TestRefill.php

@@ -286,6 +286,23 @@ class TestRefill extends TestCase
         Log::record($resp, Log::DEBUG);
     }
 
+
+    public function testBJBCB()
+    {
+        $params = [
+            'usr' => '13699279618',
+            'ord' => '710662733975412771',
+            'state' => '2',
+            'bz' => '',
+            'sgn' => 'AC9AFD254DE682D8440A97CA68B992DA'
+        ];
+
+        $resp = http_request("https://www.xyzshops.cn/mobile/refill_bjb.php", $params, 'POST');
+
+
+    }
+
+
     public function testZFKJ()
     {
         //带签名参数:mchid=1090&act=refill&op=add&cardno=100112121212212133