Closed sheam closed 5 years ago
I got the same problem today.
Exception when calling V1TransactionsApi.ListPayments: Error converting value "MASTER_CARD" to type 'System.Nullable
1[Square.Connect.Model.V1Tender+CardBrandEnum]'. Path '[6].tender[0].card_brand', line 1, position 17442.`
To overcome the problem, I added new value to CardBrandEnum. But I think it is not very good solution: change enum every time then we got unknown value. It would be better if unknown values parse as OTHER_BRAND, for example. And don't cause exception during API call.
ZyuDev, there is a MASTERCARD
enum for CardBrand. It looks like you are getting MASTER_CARD
instead and it throws an exception?
shaofu88, Yes, you are right. There is MASTER_CARD value in data i retrieve from Square account. And this value throws an exception.
I am also experiencing this issue.
Error converting value "MASTER_CARD" to type 'System.Nullable`1[Square.Connect.Model.V1Tender+CardBrandEnum]'. Path '[0].tender[0].card_brand', line 1, position 1453.
Why would the Square API be returning MASTER_CARD
instead of MASTERCARD
? Are card brands configurable in Square?
EDIT: This issue has been fixed in version 2.17.1
SeanoNET. Connect V1 is currently in maintenance, so we only resolve outstanding bugs, but we are not currently updating or changing the behavior due to us moving to V2 for all of our future APIs. Thank you for the question and using our SDK :)
This issue has been fixed in version 2.17.1.
But V2 doesn't support fetching payment information from webhooks.
You can get to a V2 transaction from a webhook. Webhooks return the entity_id
which is equivalent to payment_id
in V1, which is equivalent to tender_id
in V2. You can also get the V2 transaction from the V1 Payment object field payment_url
. The ending of it is currently always the V2 transaction_id
. In this payment_url
example, "XYZ" would be the V2 transaction_id:
https://squareup.com/dashboard/sales/transactions/XYZ
Note, there are currently no plans to deprecate V1, but we are actively working on V2 for future features and implementations.
I am retrieving payments sing
However they are failing because the the apiPayment.Tender.Type is INTERAC which does not existing in the Square.Connect.Model.V1Tender.CardBrandEnum.