diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index ce37bb6..e5a828a 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -709,7 +709,7 @@ class HttpClient } else if (strpos($type, 'json') !== false) { return json_decode($body, true); } else if (strpos($type, 'xml') !== false) { - return Help::toArray($body); + return Help::xmlToArray($body); } else if (strpos($type, 'plain') !== false) { return Help::toArray($body); } diff --git a/wchat/wx/Recharge.php b/wchat/wx/Recharge.php index 3332562..67ba4d7 100644 --- a/wchat/wx/Recharge.php +++ b/wchat/wx/Recharge.php @@ -153,8 +153,7 @@ class Recharge extends SmallProgram $array['sign'] = Help::sign($array, $key, $sign_type); $this->request->setCallback(function ($data) { - echo $data;exit; - $array = Help::xmlToArray($data); + $array = Help::toArray($data); if ($array['return_code'] != 'SUCCESS') { $data = ['code' => $array['return_code'], 'message' => $array['return_msg']]; } else if ($array['result_code'] != 'SUCCESS') {