Search code examples
cordovaionic-frameworkstripe-paymentsinappbrowser

Ionic 5 Stripe how to redirect user back to app with success_url?


I'm implementing Stripe integration in Ionic 5 app.

I'm calling redirectToCheckout method from '@stripe/stripe-js'. It opens checkout process in external browser. Everything is fine, but I need back user to app when checkout will be finished.

How can I do that?

How to setup success_url, to make it redirect to native app from browser?


Solution

  • You need to set up a custom URL scheme in your Ionic app (like my-app://) and then redirect to that URL after Checkout is complete.

    Note that Stripe Checkout Sessions require success_url to be a valid internet-routable URL, so you'll need to point success_url to a page on your server that in turn redirects to your app's custom URL scheme.