-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JsonEncode error: 43 is invalid for PaymentAdviceCode #11
Comments
Hey @james-ingold Would you happen to have a debug ID for an instance where this occurred? Looking at the class that threw the exception, the returned code is definitely not one of the expected values, so I'm trying to sort out all the details to determine when/why this code returned, and ensure it and any others that might be missing can be added. |
I think the logs on my end recycled, I'm not able to find the order/debug id for this error but I will keep an eye out if we I another instance of this error. |
Entirely understandable on the log rotation. What logs you did have do tell us what happened fairly clearly, but having a debug gives us specifics around the entire lifecycle of a request, which can often shorten the investigation period and speed up getting a resolution. I'm going to raise this with colleagues on our API teams now as I believe we have enough to go on, but if you see this happen again, nabbing a debug ID would always be welcome. I'll update you here as soon as possible with any details or follow ups. |
Added a new constant ENUM_43 with the value '43' Including self::ENUM_43 in the _ALL_VALUES array Updates ProcessorResponse class to handle unknown payment advice codes gracefully
Fixes paypal#11 43 is invalid for PaymentAdviceCode
This happened when trying to json encode the ordersCapture response for logging purposes:
2024-11-07T15:31:52.135108+00:00 app[web.1]: [07-Nov-2024 15:31:52 UTC] [2024-11-07 15:31:52] production.ERROR: 43 is invalid for PaymentAdviceCode. {"userId":"the_user_id","exception":"[object] (Exception(code: 0): 43 is invalid for PaymentAdviceCode. at /app/vendor/paypal/paypal-server-sdk/src/Models/PaymentAdviceCode.php:48)
2024-11-07T15:31:52.135122+00:00 app[web.1]: [stacktrace]
2024-11-07T15:31:52.135194+00:00 app[web.1]: #0 /app/vendor/paypal/paypal-server-sdk/src/Models/ProcessorResponse.php(144): PaypalServerSdkLib\Models\PaymentAdviceCode::checkValue()
2024-11-07T15:31:52.135247+00:00 app[web.1]: 1 [internal function]: PaypalServerSdkLib\Models\ProcessorResponse->jsonSerialize()
The text was updated successfully, but these errors were encountered: