How about this as a suggested modification to the source code?
$ 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?
Describe the bug If the HTTP status code of the Check Cashback Details response is 200, I don't want to raise an exception. https://github.com/paypay/paypayopa-sdk-php/blob/bea1bb11ad7b19d4ca532bce23e437126ddc193d/src/core/Controller.php#L171
For example, if NOT_ENOUGH_MONEY is raised, I want to get the cashbackId included in the response body.
https://www.paypay.ne.jp/opa/doc/jp/v1.0/cashback#section/%E3%83%AC%E3%82%B9%E3%83%9D%E3%83%B3%E3%82%B9%E3%82%B3%E3%83%BC%E3%83%89%E4%B8%80%E8%A6%A7
How about this as a suggested modification to the source code?
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?
https://www.paypay.ne.jp/opa/doc/jp/v1.0/cashback#operation/checkCashback