#reygo_code
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/1341435746992783421
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- reygo_code, 30 minutes ago, 5 messages
const initializePaymentSheet = useCallback(async () => {
setLoading(true);
const { error } = await initPaymentSheet({
merchantDisplayName: "Bla",
returnURL: `${host}/stripe-redirect`,
intentConfiguration: {
mode: {
currencyCode: currencyCode,
setupFutureUsage: "OffSession" as FutureUsage,
},
confirmHandler: confirmHandler,
},
applePay: {
merchantCountryCode: countryIsoCode || "US",
},
googlePay: {
merchantCountryCode: countryIsoCode || "US",
testEnv
},
});
if (error) {
console.tron.log(error);
handleError(error.message);
}
setLoading(false);
}, [
confirmHandler,
countryIsoCode,
currencyCode,
handleError,
host,
initPaymentSheet,
testEnv,
]);
const presentPaymentSheetAction = useCallback(async () => {
await initializePaymentSheet();
const { error } = await presentPaymentSheet();
if (error && error.code !== PaymentSheetError.Canceled) {
console.tron.log(error);
// PaymentSheet encountered an unrecoverable error. You can display the error to the user, log it, etc.
handleError(error.message);
}
}, [handleError, initializePaymentSheet, presentPaymentSheet]);
build gradle
Hello again
Looks like you haven't added:
dependencies {
implementation 'com.stripe:stripe-android:21.4.2'
}
In your build.gradle. See: https://docs.stripe.com/payments/accept-a-payment?platform=react-native#set-up-your-integration
We do have implementation 'com.stripe:stripe-android:20.15.4'
In our app/build.gradle
Can you share that file? And what about your AndroidManifest.xml as well?
Also are you testing on a simulator or an actual device?
I'm testing on a real device
And do you have a live test card in your wallet or are you using the Google Developer cards?
Can you go to https://docs.stripe.com/elements/express-checkout-element on your live device and confirm you can successfully use Google Pay on that site?
From the device you are testing with
Okay good to know.
What version of the React Native SDK are you using and can you share the files I mentioned above?
I can't share the whole manifest since it contains a lot of sensitive info but <meta-data android:name="com.google.android.gms.wallet.api.enabled" android:value="true" /> is there
We are on RN 0.76.5
Sorry the Stripe RN SDK
"@stripe/stripe-react-native": "0.41.0",
So, latest
Unfortunately updating the implementation didn't work
This is what's happening
Looking/thinking...
Thanks!
Are you using Connect here?
It's a PaymentSheet
I know but you are not a platform, correct?
Can you share a PaymentIntent ID that was successful with Card?
But no we're not using connect
Sure
We use setup intent
Is that fine?
seti_1QttVfC5YI2qtT0Nbn3yjqJD
Ah
Because we finalize payments server-side
I'm not sure Google Pay is supported in this flow... though I don't know why that would be the case. It isn't listed in our integration guide (https://docs.stripe.com/payments/mobile/finalize-payments-on-the-server?platform=react-native&type=setup)
Looking more to see if I can confirm that.
Yeah I agree it would be strange
Ah ah I think you might be missing passing currencyCode within the googlePay hash.
I think you need to pass it twice
Both in intentConfiguration and in googlePay
googlePay: {
merchantCountryCode: 'US',
currencyCode: 'USD', // currency must be specified for setup mode
testEnv: true, // use test environment
},
Try that
Ugh
That's "incredible"
-y frustrating
Yeah sorry that our error message isn't better there...
Or change the type checking
I'll flag that feedback internally
๐