For example, if NOT_ENOUGH_MONEY is raised, I want to get the cashbackId included in the response body.
$ git diff
diff --git a/src/core/Controller.php b/src/core/Controller.php
index 8a77021..b68b4cf 100644
--- a/src/core/Controller.php
+++ b/src/core/Controller.php
@@ -167,7 +167,8 @@ class Controller
*/
protected function parseResultInfo($apiInfo, $resultInfo, $statusCode)
{
- if (strcmp($resultInfo['code'], "SUCCESS") !== 0 && strcmp($resultInfo['code'], "REQUEST_ACCEPTED")) {
+ $acceptStatusCodeList = [200, 202];
+ if (in_array($statusCode, $acceptCodeList, true) === false) {
throw new ClientControllerException(
$apiInfo,
$resultInfo, //PayPay API message
Also, let me ask you one question.
If the response code is NOT_ENOUGH_MONEY, BALANCE_OUT_OF_LIMIT, or INTERNAL_SERVICE_ERROR, will the data.status in the response body be FAILURE?
In what cases does data.status become FAILURE?