JSON Parse exception on Java SDK Error handling #339
Comments
Can you please put the code on a test repo instead? Also, what's your client Id so that we may be able to do more researching from the backend. |
The clientID "AdJbvXS9rxpE0RpKbyDNWgdMuUFzzQGqagF6iyAz9nx8zNaG_SH2rnMHU53RQNJrF3c-DrCBEO6w1LHX" |
I noticed something: {
"name": "AMOUNT_MISMATCH",
"message": "The totals of the cart item amounts do not match sale amounts.",
"information_link": "https://developer.paypal.com/docs/api/payments/#errors",
"details": "The amount total does not match the item amount totals."
} But, the Error class is: public class Error extends PayPalModel {
private String name;
private String message;
private List<ErrorDetails> details;
private String informationLink;
private String debugId;
private List<DefinitionsLinkdescription> links;
[...]
} The "details" property between JSON and Java model are inconsistent. |
Do you have a debug ID for it? |
No, because the server responded appropriately. |
There is the client-side log with DEBUG level:
|
Thanks for the details. I've opened https://github.com/paypal/PayPal-REST-API-issues/issues/197 to track this issue as the negative testing API is not returning a standard error response. We cannot change the |
So, there's no other way to simulate it? |
@leandrohsilveira I don't believe so. The negative test simulation was recently added as a beta. I've opened an internal issue as noted in https://github.com/paypal/PayPal-REST-API-issues/issues/197 to get this fixed. |
Ok, thanks |
Hi all, This just came to my team today. Apologies for the delayed response. However, we are currently building a more comprehensive negative testing framework, and this is definitely something we will be taking into account. As to the current method, and because of the experimental nature of it, we can't commit to additional development time, or bug fixes at this point. I would be more than happy to have feedback sessions on what developers are looking for in a negative testing framework from PayPal. Please hit me up on twitter @LennyMarkus |
General information
PayPal-Debug-ID
values: It's a client-side errorIssue description
My current task is to improve the application Payment error handling.
Currently the application is simply catching all exceptions, logging and redirecting to a generic error page.
Now i need to catch the REST API error message to handle it properly.
So, i'm trying the negative testing (https://developer.paypal.com/docs/api/nt-rest/) to validate my error handling implementation, but i'm unable to reach the response error message due to a JSON Parse error.
I've implemented a simple proof of concept, the craziest JUnit i ever wrote, it will reproduce my issue almost automaticly:
proof-of-concept.zip
The text was updated successfully, but these errors were encountered: