Closed robinkanters closed 6 years ago
Hey @robinkanters,
Thanks for reporting. I have a felling this has to do with 1 or multiple payments inside the LIST where
$.object.Payment.geolocation.latitude
is actually populated with data while the deserialiser expects nothing. Which doesn't make sense to me yet :thinking: Ill see if i can reproduce and find a fix :thumbsup:.
@OGKevin that sounds correct, that is what the error says haha!
@robinkanters btw, how did you make the draft payment ? Via API or inside the bunq app ? Save's me some time finding out how to get $.object.Payment.geolocation.latitude
populated with data :grin:
@OGKevin via the api
@OGKevin it's just this, nothing special
return DraftPayment.create(apiContext, mapOf(
"status" to "PENDING",
"entries" to listOf(mapOf(
"amount" to Amount(paymentOrder.amount.toString(), paymentOrder.currency),
"counterparty_alias" to makePointer(paymentOrder.to, paymentOrder.name),
"description" to paymentOrder.description,
"merchant_reference" to paymentOrder.uniqueKey
)),
"number_of_required_accepts" to 1
), userId, from).value
@robinkanters I could not reproduce with the following snippet:
List<DraftPaymentEntry> entries = new ArrayList<>();
entries.add(new DraftPaymentEntry(
new Amount("0.01", "EUR"),
new MonetaryAccountReference(counterPartyAliasOther),
"Test"
));
HashMap<String, Object> requestMap = new HashMap<>();
requestMap.put(DraftPayment.FIELD_NUMBER_OF_REQUIRED_ACCEPTS, 1);
requestMap.put(DraftPayment.FIELD_STATUS, "PENDING");
requestMap.put(DraftPayment.FIELD_ENTRIES, entries);
int draftPaymentId = DraftPayment.create(getApiContext(), requestMap, userId, monetaryAccountId).getValue();
DraftPayment.list(getApiContext(), userId, monetaryAccountId);
DraftPayment.get(getApiContext(), userId, monetaryAccountId, draftPaymentId);
:thinking: Later today ill try reproducing with a manually made json with the field $.object.Payment.geolocation.latitude
populated and deserialise the object then.
@OGKevin maybe it's choking on another payment on my MA, don't know how to figure out which though
@OGKevin try accepting the draft payment (in the app) and then listing them for that MA.
It seems to choke on the geolocation on the linked payment instance for some reason. (edit: duh, that's what the error says haha)
If you want to dive into the database, it's payment id removed
for draft payment id removed
.
Edit: removed ids for privacy reasons.
I found a workaround for my personal situation, but it still seems like an important issue to me.
never mind, that also doesn't work
@robinkanters I think that might be it indeed.
I removed the payment ids for privacy reasons. I did write them down so I’ll have a look indeed 👍.
Once I’ve found a way to reproduce, I should be able to fix it and provide a test so that it doesn’t come back later on 😄. I’ll try your accept in bunq app suggestion as well, if this doesn’t work neither then I’ll try with a manual made raw json.
I removed the payment ids for privacy reasons
who cares 😉 wouldn't have posted them if I'd have been concerned about that
manual made raw json
~yeah so I'm building the request data with a java Map (not by setting properties on a DraftPayment instance), so that might be different from what you're doing. try my snippet 👍~
oh wait that is actually what you're doing. no idea what the difference is then
@robinkanters reproduced :thumbsup:.
Ill plan to fix this in 0.12.5
.
@OGKevin no doubt you noticed, but just for completeness: this also happens for listing Payment
s 😉
@robinkanters yes your indeed correct! It was due to a silly miss type 🤦♂️
Steps to reproduce:
What should happen:
What happens:
Logs