#prateek_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1280464897519386675
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Do you have a valid/real card in your Google Wallet on the device you are testing with ?
Yes, when our client tested it from USA; then they also added their card to the wallet.
did you set the fields in the XML file as described at https://docs.stripe.com/payments/accept-a-payment?platform=react-native&ui=payment-sheet#set-up-your-integration ?
what does your exact code look like?
We have tried 3 different ways:-
- By displaying all the available payment methods which are active from the dashboard within the payment sheet. By following this video from stipe's official YouTube Channel: https://youtu.be/uK7W5x_8gbg?si=ZlMHUhfQMeMuPYY3
- We followed this documentation for directly paying through Gpay: https://docs.stripe.com/payments/accept-a-payment?platform=react-native&ui=payment-sheet
- Displaying Stripe Checkout page in WebView: https://docs.stripe.com/payments/accept-a-payment?platform=web
well let's focus on one of those approaches, which do you want to use?
I will say I don't think option 3 works, Google Pay doesn't support WebViews.
So really it's just option 1(PlatformPay integration) or 2(PaymentSheet)
Okay, then lets try with Option 1
ok.
- did you set up the XML file as described at https://docs.stripe.com/google-pay?platform=react-native#react-native-create-enable-google-pay ?
- Show me the complete code of your component where you implemented this
- What version of stripe-react-native are you using?
- in your American colleague's device, what is the return value of
isPlatformPaySupported(please log it and check)
Yes, we have added these lines in the XML file. Can we connect on a google meet if possible?
it's not possible
okay, no problem. We are using stripe-react-native version 0.35.1
thanks, and question 2?
okay, will provide you the code. Just a minute
const res = await isPlatformPaySupported({ googlePay: { testEnv: true } })
console.log('res isPlatformPaySupported: ', JSON.stringify(res))
if (!res) {
handleShowToast({
status: SNACKBAR_TYPE.error,
description: 'Google pay is not supported'
})
} else {
const data = { packageId, paymentMethod: 'card' }
try {
const res = await processStripePayment(data)
console.log('res in process stripe payment: ', JSON.stringify(res))
console.log('client_Secret: ', res?.data?.data?.paymentIntent?.client_secret)
const { error } = await confirmPlatformPayPayment(
res?.data?.data?.paymentIntent?.client_secret,
{
googlePay: {
testEnv: true,
merchantName: 'Los Tres Reyes',
merchantCountryCode: 'US',
currencyCode: 'USD',
billingAddressConfig: {
format: PlatformPay.BillingAddressFormat.Full,
isPhoneNumberRequired: true,
isRequired: true
}
}
}
)
if (error) {
handleShowToast({
status: SNACKBAR_TYPE.error,
description: `${error.code}, ${error.message}`
})
} else {
handleShowToast({
status: SNACKBAR_TYPE.success,
description: 'Payment confirmed successfully'
})
}
} catch (err) {
console.log('error occurred while payment: ', err)
}
}
isPlatformPaySupported is returning false
hmm. Should just work. Can you test on other devices/users?
I have tested it in 4 devices. Faced same issue in all the cases
hmm. Well the next step is to provide enough code for a minimal-reproduction app project that we can run ourselves
note if you're in India it will never work
so when I say test it on other devices, I mean test on multiple devices in the US/Europe etc
okay, 2 of the tested devices were in US and Australia. Just a small doubt, if a person has not added card in their wallet, then the payment sheet will not even show the option of Gpay?
as far as I know yes; part of isPlatformPaySupported is checking that there is a card in the wallet as well
Okay
Btw, should it work if I try to test it from India and use a VPN after adding card in the gpay wallet?
I don't think so? India has an entirely different App (https://play.google.com/store/apps/details?id=com.google.android.apps.nbu.paisa.user&hl=en_US&pli=1 instead of https://play.google.com/store/apps/details?id=com.google.android.apps.walletnfcrel&pli=1 ) with different SDKs and functionality and Stripe only supports the international one
okay