#xtrakrazy
1 messages · Page 1 of 1 (latest)
Hello! To clarify, you're using the Payment Element?
Hi Rubeus! Yes, that is correct.
Can you tell me more about why you can't use stripe.confirmPayment?
Because the stripe.confirmPayment method doesn't seem to support the handleActions option.
As im building a Capacitor app, I need to handle the redirects in order to open them in the InAppBrowser.
stripe.confirmPayment handles next actions automatically.
You should not need to call a separate thing to handle actions when using stripe.confirmPayment.
According to the docs the confirmPayment method will automatically redirect as needed depending on the payment method selected?
Correct.
Eg. for Afterpay / Klarna / Zip Pay it will redirect to those platforms websites to complete the transaction
Yes.
In a Capacitor app, because the app runs in a WebView, those redirects break the application.
You can't use this in that context then. A redirect may be required for some payment methods. If you can't support that then those payments will always fail.
I have those redirects working using the Native InAppBrowser in Capacitor and handleActions: false option, so thats not so much of a problem.
The Payment Element is designed to be used on a web page, not in a web view in a Capacitor app.
The problem is that I just have no idea whether I need to call stripe.confirmAfterpayClearpayPayment() or stripe.confirmCardPayment() because I cant see what is selected?
And it's designed to be used in a web browser.
That's because you're trying to use something that's not designed for your use case.
Payment Element is designed to be used with stripe.confirmPayment, not the payment method specific methods you're talking about.
Okay, that makes sense. So in order to use those methods, I should be creating the payment forms manually?
You could use the Stripe Elements that are specific to the payment methods you want to use, but, again, those are designed to be used on a website viewed in a web browser, not inside a web view in an app like you're describing.
Redirects are required for some of them.
And things that depend on web/web browser functionality will likely break things.
Okay thank you. Will give that a try.
The redirects seem to be working perfectly, just as long as I can use the handleActions option.
Not sure how you would get that working in the app you're building.
Just grabbing an example for you, will get back to you shortly.
Hi @trim dock I'm taking over this thread, let me know if you have any questions