stripe / stripe-react-native

React Native library for Stripe.
https://stripe.dev/stripe-react-native
MIT License
1.26k stars 259 forks source link

Why amount of google pay show incorrect? #1707

Open tuanlevi95 opened 1 month ago

tuanlevi95 commented 1 month ago

when i pass amount = 100 to google pay like that:

const { paymentMethod } = await createPlatformPayPaymentMethod({
      googlePay: {
        amount: 100,
        currencyCode: "SGD",
        testEnv: Config.GPAY_TEST,
        merchantName: common.MERCHANT_NAME,
        merchantCountryCode: "SG",
      },
    })

when google pay sheet show up, the amount just show 1. its look like google pay auto divide to 100, apple pay not like that. So now i need do some tricks like: 100*100 is that a bug? if not please refer me a document about that

tientruong95apricus commented 2 weeks ago

hi @tuanlevi95 the amount description said "Provide this value in the currency’s smallest unit."

I just saw the docs:

I think because Android amount type is number, so it automatically shows by cent, while Apple Pay use amount as string