#abhishekashyap_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/1325835008643960956
π 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.
- abhishekashyap_code, 3 days ago, 13 messages
- abhishekashyap_code, 4 days ago, 41 messages
What do you mean exactly by 'not working'? What behaviour do you expect, what happens? What are you trying to do?
Also, version 0.76 and 0.71 of what?
0.76 and 0.71 version of react native. By not working I mean the stripe redirect is not happening. I'll explain the flow. When I click on pay button in my app, it open the stripe sheet. When i click on any of the payments method in test mode, I'm presented with a screen that opens in in-app browser, not if i authorize the payment, the in-app browser is not closing (re-direct not happening back to app).
In the app that is using 0.76 version of react native, the browser closes and status of the payment is displayed (expected behaviour). But in 0.71 version of react native, the browser never closes.
Which version of our RN SDK are you using? What's the return_url you're using?
I'm using 0.40.0 of @stripe/stripe-react-native in both of these apps
The return url I'm using is url-scheme-of-app://stripe-redirect
Have you correctly configured the deep links? https://docs.stripe.com/payments/accept-a-payment?platform=react-native&mobile-ui=payment-element#react-native-set-up-return-url
Yes, as informed. I'm using the same deep link configurations for both these apps.
Right, just checking as you've not really shared any code relevant to the part in question (initPaymentSheet etc)
Sure, let me do that
What's curious is from your screenshot it appears that the auth/3DS page is in an in-app browser?
Normally it should redirect outside of the app to Safari, and then the return URL is called with the deep link to go back
const { error: errorInInitialization } = await initPaymentSheet({
merchantDisplayName: "Amber Healthcare Solutions Pvt Ltd.",
paymentIntentClientSecret: clientSecret,
allowsDelayedPaymentMethods: true,
returnURL: "stripe-test://stripe-redirect",
})
if (errorInInitialization) {
console.error("errorInInitialization: ", errorInInitialization)
}
const { error: paymentError } = await presentPaymentSheet()
if (paymentError) {
console.error("paymentError: ", paymentError)
}
Does it behave differently between the RN versions? e.g. is one in-app the other native Safari?
No, it opens in both cases inside in-app browser. Although I can override that behaviour by clicking on bottom right corner of in-app browser (on safari icon) and it redirects me back to the app after authorizing the payment, but still the in app browser never closes.
Another thing to note is that if i manullay close the browser from top left Close button, the stripe sheet displays the correct payment status.
Hence, I have concluded that the issue is specific to re-direction.
Can you share the exact versions of the the Stripe iOS pod you're using in each build?
Sharing the screenshot of Manifest.lock for the app using RN 0.71
Sharing the screenshot of Manifest.lock for the app using RN 0.76
Can you share the relevant deep link code?
Yes, sure
And to confirm there's no logs/errors thrown on 0.71 build?
const { handleURLCallback } = useStripe()
const handleDeepLink = useCallback(
async (url: string | null) => {
console.log("deep link called: ", url)
if (!url) return
try {
const stripeHandled = await handleURLCallback(url)
console.log("stripeHandled: ", stripeHandled)
if (!stripeHandled) {
// This was NOT a Stripe URL β handle as you normally would
// const { path, queryParams } = Linking.parse(url)
// console.log("Deep link path:", path, "params:", queryParams)
console.log("Not stripe handled")
}
} catch (error) {
console.error("Deep link handling error:", error)
}
},
[handleURLCallback],
)
useEffect(() => {
const getUrlAsync = async () => {
try {
const initialUrl = await Linking.getInitialURL()
handleDeepLink(initialUrl)
} catch (error) {
console.error("Error getting initial URL:", error)
}
}
getUrlAsync()
const deepLinkListener = Linking.addEventListener("url", (event: { url: string }) => {
handleDeepLink(event.url)
})
return () => deepLinkListener.remove()
}, [handleDeepLink])
There are no errors logged or thrown
The handleDeepLink function is not getting called in 0.71 after I authorize the payment whereas in 0.76 it is getting called.
const linking = {
prefixes: ["stripe-test://", "stripetest://"],
config: {
screens: {
Login: {
path: "",
},
Welcome: "welcome",
Demo: {
screens: {
DemoShowroom: {
path: "showroom/:queryIndex?/:itemIndex?",
},
DemoDebug: "debug",
DemoPodcastList: "podcast",
DemoCommunity: "community",
},
},
},
},
}
This is my linking object if this might help
Hi there π I'll be taking over the thread as my teammate needs to step away soon. I'm admittedly not too familiar with React Native, but wanted to double check something. You're not using Expo for your project, correct?
It is the same for the other app, just with different prefixes
Yes, I'm not using expo
Thank you for confirming that! We're not sure what could be going wrong offhand; whether this should be handled a bit differently in older rn versions, whether there is some sort of incompatibility with the older version, or whether it's something else entirely; so I'd like to ask that you write in to us with those details so we can take a closer look and either get you a solution or escalate this to the team that owns that SDK for further review.
I'm about to have one of our bots DM you a link to create a case with us. If you could please complete that flow and share the details you've collected from your debugging up to this point. If you have a sample application that you can share with us as well, which we can use to see a reproduction of the behavior you're describing, please include that as well as it will be insightful.
Hello @nova arrow, we have sent you a direct message, please check it at https://discord.com/channels/@me/1324287981481361488
- πThe message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.