invertase / stripe-firebase-extensions

Repository of Firebase Extensions built by Stripe.
https://firebase.google.com/products/extensions
Apache License 2.0
437 stars 167 forks source link

success_url and cancel_url not working in mobile #587

Open rcpilotp51 opened 10 months ago

rcpilotp51 commented 10 months ago

How do you get the redirects working in a ionic 7 app?

Deep Linking doesn't seem to be working using Ionic 7 and Capacitor.

When I go to "domain" from either Chrome or Safari in the Sim or my native ios device, the website resolves and doesn't open the application as expected. (I have not tested the deep linking on an Android device as of yet - I've been focusing on iOS first - hoping it would translate - however, I have made the recommended changes to the manifest files and, as mentioned before, I am hosing the json file on my site.)

The reason I wanted to get this working is because I am using the Firebase Stripe Extension that requires a success_url and cancel_url in its implementation to redirect the user back to the app. As you might expect, this works well on the Ionic PWA site, but not natively. I was hoping that deep linking would be the solution to avoid a more manual install and implementation of Stripe.

The Stripe documentation for the firebase extension recommends using the window.location.origin as both the success and cancel urls. window.location.origin translates to capacitor://localhost natively, and stripe errors saying this is an invalid url. I then tried to use the deep link of "domain" as the redirect url in both cases, which is accepted by Stripe as a valid url, but the user is redirected to the default browser and linked to the PWA deployment.

My ask is if it is possible to get some sort of universal link to the site as a redirect url that will work both natively and for the PWA deployment? could I implement a switch/case that would detect the platform and substitute the correct redirect.

evancaldwell commented 1 month ago

I'm also running into this exact issue. Has anyone figured this out yet?