diff --git a/wchat/wx/V3/TransferBatches.php b/wchat/wx/V3/TransferBatches.php index b0d5fd2..7c41ed0 100644 --- a/wchat/wx/V3/TransferBatches.php +++ b/wchat/wx/V3/TransferBatches.php @@ -19,7 +19,7 @@ class TransferBatches extends SmallProgram * @throws Exception */ #[ArrayShape(['code_url' => "string"])] - public function request(TransferDetail $detail): array + public function request(TransferDetail $detail): array|string { $body = []; $body['appid'] = $this->getConfig()->getAppid(); @@ -46,8 +46,10 @@ class TransferBatches extends SmallProgram $client->post('/v3/transfer/batches'); $client->close(); - var_dump($client); - - return json_decode($client->getBody(), TRUE); + $data = json_decode($client->getBody(), TRUE); + if (json_last_error() != JSON_ERROR_NONE) { + return $client->getBody(); + } + return $data; } } \ No newline at end of file diff --git a/wchat/wx/V3/WxV3PaymentTait.php b/wchat/wx/V3/WxV3PaymentTait.php index 8275b27..e3d61c5 100644 --- a/wchat/wx/V3/WxV3PaymentTait.php +++ b/wchat/wx/V3/WxV3PaymentTait.php @@ -42,7 +42,6 @@ trait WxV3PaymentTait $rand = md5(random_bytes(32)); $time = time(); - var_dump($body); $message = sprintf("%s\n%s\n%d\n%s\n%s\n", $http_method, $canonical_url, $time, $rand, $body); $sign = $this->openssl_signature($message);