#Kóré Levi-return_url
1 messages · Page 1 of 1 (latest)
Your return_url is a localhost URL which I guess is unreachable from your compiled build
You'd need to point that to the production/live URL in your actual app
The return_url is reachable from the combpiled build, is working fine if I use the stripe payment without redirecting to a thir party website.
Btw, I dont know where i can get the production/live url from my app
Can you share your confirmPayment code please
I am using the Stripe.js library. The confirmPayment method is described in that library
https://stripe.com/docs/js/payment_intents/confirm_payment
let result = await stripe.confirmPayment({
elements,
confirmParams: {
return_url: window.location.href
},
});
return_url: window.location.href is the issue
That's compiling to https://localhost/index.html which is unreachable
https://localhost/index.html is reacahble.
Is working fine if the stripe does not redirect to a third party website.
So, with stripe card payment is working fine, the return_url redirect to https://localhost/index.html?payment_intent=xxetc , and the app handle the parameters from the return_url, and creates the order/show error message etc.
The error occurs when I try to pay for example with bancontact. The confirmPayment redirects to the bancontact payment gateway, but when the payment gateway redirects to the app I'm getting the error described ..
I'm not sure really, this is not a supported set up really (using Cordova, we don't have any official libraries, and we expect stripe.js to be used in full browsers and not a mobile app with an in-built server in that way)
Hmm ..I get it.
I hope I can find a solution to it.
Anyway, thanks
@sick junco @lament rune maybe could you help me with a bit information about the confirmPayment method?
What that method exaclty does? Open it a new url using the window.location ?
I just wan to reproduce the issue with a simple test environment without stripe, but I dont know the steps after the confirmPayment method was called
it can do many things, if it's a card payment it might open a modal popup for 3D Secure, if it's a redirect-based payment method like Bancontact it would redirect the browser to the bank's authentication page
Thanks, and maybe can you tell me exactly what code fragment it redirects to the bank's authentication page?
Because in Cordova build it is possible to open it in an inApp (in appliaction) browser or in the default browser of the device (Safari, Chrome, Firefox etc). And in our case it seems that the bank page is not opened in an external browser, but inside the application. However, we don't know how/with what code it does this.
That is, what function stripe.js uses to open the bank page in the redirect-based case.
Thanks, and maybe can you tell me exactly what code fragment it redirects to the bank's authentication page?
I can't, that's an implementation detail
pretty sure we just set window.location really, since again stripe.js has no idea what Cordova is or the environment it's in, it is designed for being used in a normal browser window.