Explorar o código

dinghui add api update

xiaoyu %!s(int64=3) %!d(string=hai) anos
pai
achega
752b42e2b6

+ 14 - 2
helper/refill/api/xyz/dinghui/RefillPhone.php

@@ -31,7 +31,7 @@ class RefillPhone extends refill\IRefillPhone
         $params['sign'] = $sign;
 
         $url = config::API_URL;
-        return http_request($url, $params, 'POST', false, [], $net_errno);
+        return http_request($url, $params, 'POST', false, []);
     }
 
     private function req_params(int $phone, int $card_type, int $amount, string $order_sn)
@@ -58,7 +58,19 @@ class RefillPhone extends refill\IRefillPhone
         $params = $this->req_params($card_no, $card_type, $amount, $params['order_sn']);
 
         $message = $this->pub_message($params);
-        $resp = $this->url_request($message,'order.charge.query');
+
+        $req['msgtype'] = 'request_msg';
+        $req['format'] = 'json';
+        $req['version'] = '1.0';
+        $req['app_id'] = config::APP_ID;
+        $req['timestamp'] = $this->getMillisecond();
+        $req['method'] = 'order.charge.query';
+        $req['channel'] = 'wap';
+        $req['request_id'] = "REQ".$params['timestamp'];
+        $req['message'] = $message;
+        $sign = $this->sign($req);
+        $req['sign'] = $sign;
+        $resp = http_request(config::API_URL, $req, 'POST', false, [], $net_errno);
 
         if (empty($resp)) {
             return [false, '系统错误', true];

+ 1 - 1
helper/refill/api/xyz/shuoruan/RefillPhone.php

@@ -25,7 +25,7 @@ class RefillPhone extends refill\IRefillPhone
         $req = json_encode($req);
 
         $url = config::API_URL;
-        $resp = http_post_data($url, $req, config::ExtHeaders, $net_errno);
+        $resp = http_post_data($url, $req, config::ExtHeaders);
         return iconv('GB2312', 'UTF-8', $resp);
     }
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2 - 2
test/TestRefill.php