flutter-plugin
flutter-plugin copied to clipboard
Wrong exported ApplePay json: paymentMethod: { ..., type: 1 }
According to Apple's documentation, The payment method type can be one of the following string values:
"debit" "credit" "prepaid" "store"
While the received json exported by this library returns the type key as an integer type: 1
I had also to correct the exported key called token
to be paymentData
, but for the type
key I couldn't correct it, as the mapping between card types (debit, credit, prepaid, store) and their integer equivalents are not documented anywhere.
But at least I know debit -> 1 (according to the card I was using in my test), any idea about the remaining types?
debit -> 1 credit -> ? prepaid -> ? store -> ?
I also added a credit card, and it returns '2'..
So apparently the mapping is like the following:
debit -> 1 credit -> 2 prepaid -> 3 (not sure) store -> 4 (not sure)
Please @JlUgia, can you confirm.
Hi @oremlawi I'm not sure I follow. What are you referring to when you say the "JSON exported by this library"? I also noted that the link you shared above refers to the Payment Request API integration. Note that, for the time being, this plugin only supports the iOS platform for Apple Pay. The API for the native integration differs from the Web APIs.
Hi @oremlawi
I had the same question and this is what I found on PassKit
The method type has the following declaration enum PKPaymentMethodType : UInt
Thank you for the reply @volodymyr-kam-nrtl .
This fields are currently only JSON-deserialized before sent back to the Flutter end. Would you find it valuable to use a string-typed key instead?
Feel free to reopen this issue if you have additional feedback.