#ntwork-nick-React-Native

1 messages · Page 1 of 1 (latest)

abstract pond
#

Hi there

radiant canyon
#

hello

abstract pond
#

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?

radiant canyon
#

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?

abstract pond
#

You need to deep link here.

radiant canyon
#

right, which i've done

abstract pond
#

Oh? And it isn't redirecting back to your app?

#

(watching video now)

radiant canyon
#

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

abstract pond
#

Hrmmm my understanding is that if you are deep linking on your return_url then it should pop you back into your app

radiant canyon
#

as in, the stripe SDK will handle the dismissal of the safari web view if a return url is provided?

abstract pond
#

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

radiant canyon
#

gotcha, that's not the behavior i'm seeing. let me re-run it with some log statements for you.

abstract pond
#

That'd be great

radiant canyon
#

sounds good. will get back to you once i'm out of a meeting i'm in

radiant canyon
#

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.

spare ravine
#

Hello! let me catch up

abstract pond
#

👋

#

Can you share you deep linking code?

radiant canyon
abstract pond
radiant canyon
#

ah, that is the missing piece i was looking for. so the invocation of handleURLCallback() will dismiss the safari webview?

abstract pond
#

Yes

#

Give that a try and let us know if you run into any issues while implementing that!

radiant canyon
#

yes will do, appreciate the help