#ntwork-nick-React-Native
1 messages · Page 1 of 1 (latest)
hello
Sorry, helping a few folks at once
Will look in a sec!
Ah yes, I don't think this method exists in the library currently
I do think it has been requested in the past.
Let me check on that
Wait wait
Let me back up
I think I misunderstood
The above is after the Klarna redirect has been completed, no?
And you are talking about getting back to your app from there?
yeah, the klarna flow is completed but there is no way (as far as i know) to dismiss that safari webview that the SDK brings up
^ that's a video of the flow we've implemented.
once we invoke confirmPaymentSheetPayment (from usePaymentSheet) and go through klarna, what can i invoke to dismiss that safari webview?
You need to deep link here.
right, which i've done
that webview is sitting inside the app
it's not a redirect to the safari app. it's embedded inside our app
so even if i add a redirect url and try to use our app's navigation layer to route to a different screen, it can't dismiss that web view
Hrmmm my understanding is that if you are deep linking on your return_url then it should pop you back into your app
as in, the stripe SDK will handle the dismissal of the safari web view if a return url is provided?
If that return URL involves a deep link then yes. I thought we had some documentation on this... let me see if I can find it
gotcha, that's not the behavior i'm seeing. let me re-run it with some log statements for you.
That'd be great
sounds good. will get back to you once i'm out of a meeting i'm in
here are some relevant code snippets
// entering the checkout summary screen
await initPaymentSheet({
returnURL: 'thentwrktest://stripe-merchant-return',
...
});
// pressing the buy w/ klarna button.
confirmPaymentSheetPayment()
the returnURL properly propagates back into our application. you can see that in the logs in my terminal window. we have code that parses the deeplink URI and pushes navigation operations (we use react-navigation v6). telling the navigation router to goback() or navigate() to a new screen does nothing to dismiss the native safari webview that the stripe SDK brings up.
Hello! let me catch up
how much do you need? there's quite a bit of code written in our codebase.
at a high level though, we're using this to subscribe to deeplinks: https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution
and implementing our routing logic basically like this: https://help.branch.io/developers-hub/docs/react-native#navigate-to-content
The Stripe-specific code would be helpful. Like you followed: https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-set-up-return-url, correct?
ah, that is the missing piece i was looking for. so the invocation of handleURLCallback() will dismiss the safari webview?
Yes
Give that a try and let us know if you run into any issues while implementing that!
yes will do, appreciate the help