#dalton-returnUrl-reactNative
1 messages · Page 1 of 1 (latest)
Hi 👋
Can you share more details about your integration? What value are you passing for the return_url parameter?
None, but I set urlScheme and my publishable key to the init stripe params. Url scheme looks like lts://
Can you provide both the link to the docs you are following as well as a snippet of the code that is throwing this error?
https://stripe.dev/stripe-react-native/api-reference/index.html#initStripe
export function useInitStripe(path?:string) {
const doInit = async () => {
try {
await initStripe({
publishableKey: "pk_test_XXX",
urlScheme: Linking.createURL('')
})
} catch (err) {
console.log(err)
}
}
useEffect(() => {
doInit()
}, [path])
}
https://stripe.dev/stripe-react-native/api-reference/index.html#confirmSetupIntent
const {setupIntent:confirmedSetupIntent, error:siError} = await confirmSetupIntent(data.client_secret, {
paymentMethodType: 'Card',
paymentMethodData: {
billingDetails
}
}, {setupFutureUsage: 'OffSession'})
if (siError) {
console.log(siError)
showToast('error', siError.localizedMessage)
return
}
Nvm, apparently redirecting to the app without a path is not possible? lts:// does not work, but adding extra path segments does: lts://Settings/
Is this intended behavior?
Yes, A path is required for many payment method types so, to prevent more downstream failures, we require it earlier on
This should be noted somewhere. I would fully expect a redirect back to my app using lts:// without path segments to work? Not a problem, though. Will just keep that bit in mind for next time. Thanks for the help!
I'm glad we were able to figure it out. I supsect that we need some value to pass back to the API so that the request to confirm the setup passes API validation logic. While the lack of a path segment might redirect properly in the app it may still fail API validationl
Oh for sure. I understand why it is how it is lol Just would have saved some time if that was noted in the react native sdk docs. urlScheme does not imply that it must be a complete path in the init params
Good call out. I will pass along that feedback