From 2d478fb82f6ac6be5ed147f148ebd9b94dc511db Mon Sep 17 00:00:00 2001 From: leon-zhang-awx Date: Fri, 26 Apr 2024 10:56:34 +0800 Subject: [PATCH] Fix get intent status response type --- Model/Client/Request/PaymentIntents/Get.php | 2 +- Model/Service.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Model/Client/Request/PaymentIntents/Get.php b/Model/Client/Request/PaymentIntents/Get.php index fdf6c9e..d0f0b46 100644 --- a/Model/Client/Request/PaymentIntents/Get.php +++ b/Model/Client/Request/PaymentIntents/Get.php @@ -54,7 +54,7 @@ protected function getUri(): string */ protected function parseResponse(ResponseInterface $request): string { - return $request->getBody()->getContents(); + return $request->getBody(); } /** diff --git a/Model/Service.php b/Model/Service.php index 2685579..67bc175 100644 --- a/Model/Service.php +++ b/Model/Service.php @@ -206,7 +206,7 @@ protected function checkIntent($id) $resp = $this->intentGet->setPaymentIntentId($id)->send(); $respArr = json_decode($resp, true); - if (!in_array($respArr['status'],["SUCCEEDED","REQUIRES_CAPTURE"])) { + if (!in_array($respArr['status'], ["SUCCEEDED","REQUIRES_CAPTURE"])) { throw new \Exception("Something went wrong while processing your request. Please try again later."); } }