I’m trying to implement Stripe checkout in my app. It works fine in a web browser, but I’m having a little bit of trouble with the Android app.
Here’s the workflow:
I redirect the user to the Stripe checkout page (not hosted on my server). I pass a redirect URL to Stripe.
Once the payment is complete or canceled, Stripe redirects back to my site with the URL I passed to them.
There’s no problem on the web browser, but on the mobile app the redirect wasn’t working. To make the redirect to Stripe work, I had to add this line to my mobile-config.js file:
OK, so then the redirect to stripe worked back, but then the redirect back to my site didn’t work, so I added this line to allow redirecting back to my site:
It does go to my site, but it seems like it’s opening the URL in an embedded browser separate from the app. It acts as if the user started a fresh session in a web browser (the user is logged out and Meteor.isCordova() is false).
Is there any way to make the redirect go back to the app?
I think I found a simpler solution. It seems on the Android app, the actual URL used internally is some localhost URL (http://localhost:12768)
I have the client pass the window.location.href to the server, then the server will send it to stripe, and then when it redirects back to the localhost URL it seems to work correctly.
Are you planning on supplying an iOS app to your iPhone/iPad users? If so you’ll at least need a device to test on. You’ll also need to pay for an Apple Developer Licence and technically you also need to get a Mac to compile the app on, although with a lot of messing around it is possible to do it within a virtual machine. (so I’ve read, wouldn’t dream of trying it myself )
Just put that in your /public folder, then it’s available from https://your.domain/apple-app-site-association and Apple can download it to verify that you own the domain.
Once you’ve done that it should start working. However, I’m not sure when Apple checks for the existence of that file - it might only be when you install the app, so you might have to uninstall the app and re-install it once that file is in place on your server.