We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is exactly the same issue as reported here for the python sdk
https://together.bunq.com/d/4500-no-payment-details-in-the-result-inquiries-of-a-bunq-me-tab-in-the-api/3
Confirmed that the Raw response DOES contain the expected payment detail. The issue is caused by erroneous unmarshalling here:
BunqModel.java:
protected static BunqResponse fromJson(Class classOfObject, BunqResponseRaw responseRaw, String wrapper) { JsonObject responseItemObject = getResponseItemObject(responseRaw); // RAW RESPONSE LOOKS OK, CONTAINS THE PAYMENT DETAIL JsonObject responseItemObjectUnwrapped = getWrappedContent(responseItemObject, wrapper); T responseValue = gson.fromJson(responseItemObjectUnwrapped, classOfObject); // HERE IT GOES WRONG, PAYMENT DETAIL IS EMPTY return new BunqResponse(responseValue, responseRaw.getHeaders()); }
The text was updated successfully, but these errors were encountered:
Update: The bug is caused by a difference between the Java object hierarchy and the hierarchy in the api response. The payment object is nested twice.
Unmarshalling the raw reponse as follows resolves a Payment included in the first 'inquiry_result'.
JsonObject target = jsonObject.getAsJsonArray("Response") .get(0) .getAsJsonObject() .getAsJsonObject("BunqMeTab") .getAsJsonArray("result_inquiries") .get(0) .getAsJsonObject() .getAsJsonObject("payment") .getAsJsonObject("Payment") // this is were the bug caused by mapping error java vs. Json is... ); Payment payment = gson.fromJson(target, Payment.class); //now unmarshals to correct object
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Steps to reproduce:
What should happen:
What happens:
Traceback
SDK version and environment
Response id
Extra info:
This is exactly the same issue as reported here for the python sdk
https://together.bunq.com/d/4500-no-payment-details-in-the-result-inquiries-of-a-bunq-me-tab-in-the-api/3
Confirmed that the Raw response DOES contain the expected payment detail. The issue is caused by erroneous unmarshalling here:
BunqModel.java:
protected static BunqResponse fromJson(Class classOfObject, BunqResponseRaw responseRaw, String wrapper) {
JsonObject responseItemObject = getResponseItemObject(responseRaw); // RAW RESPONSE LOOKS OK, CONTAINS THE PAYMENT DETAIL
JsonObject responseItemObjectUnwrapped = getWrappedContent(responseItemObject, wrapper);
T responseValue = gson.fromJson(responseItemObjectUnwrapped, classOfObject); // HERE IT GOES WRONG, PAYMENT DETAIL IS EMPTY
return new BunqResponse(responseValue, responseRaw.getHeaders());
}
The text was updated successfully, but these errors were encountered: