Closed brianpham93 closed 5 years ago
I got it. Need to convert to minor unit, which is cent
, 1/100 of a SGD. So need to multiply with 100 to get a cent value
Hi @brianpham93 Could you please specify where have you multiplied with 100. Did you multiply in the PKPaymentSummaryItem or in the amount specified in makePayment or in drop-in configuration
@gokulas1996
PKPaymentSummaryItem - takes NSDecimal as is.
Drop-In expects "minor units": 1005 = "10 EUR 05 cents"
@descorp The issue was with the test card I was using. Thanks
This issue actually is not really due to adyen-ios library, however I think can find Adyen dev team's help here
I initiated an Apple Pay authorization using PassKit as instructed by Apple, with a transaction amount of 1.10SGD. However, whenever I sent this amount along with paymentData.token to Adyen's
/payments
endpoint, it will returnTo investigate, I temporarily decrypted paymentData.token by reproducing Apple Pay authorization against my own Merchant ID, which I hold private key. Decryption is done by this library https://github.com/sidimansourjs/applepay-token. On decrypted data, I see that transaction amount is
110 SGD
instead of1.10 SGD
as reflected on iPhone screen. Then, I updated my API request topayments
endpoint to reflect transaction amount as110 SGD
instead and got a successful responseOn Adyen's merchant dashboard, I could also see correct transaction amount
1.10 SGD
instead of110 SGD
as in API request.May I know how Adyen handle this case in backend and what's recommended for developer to handle transaction amount when send to Adyen's API ?
My sample code