#xtrakrazy

1 messages · Page 1 of 1 (latest)

cedar mauveBOT
cyan ice
#

Hello! To clarify, you're using the Payment Element?

trim dock
#

Hi Rubeus! Yes, that is correct.

cyan ice
#

Can you tell me more about why you can't use stripe.confirmPayment?

trim dock
#

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.

cyan ice
#

stripe.confirmPayment handles next actions automatically.

#

You should not need to call a separate thing to handle actions when using stripe.confirmPayment.

trim dock
#

According to the docs the confirmPayment method will automatically redirect as needed depending on the payment method selected?

cyan ice
#

Correct.

trim dock
#

Eg. for Afterpay / Klarna / Zip Pay it will redirect to those platforms websites to complete the transaction

cyan ice
#

Yes.

trim dock
#

In a Capacitor app, because the app runs in a WebView, those redirects break the application.

cyan ice
#

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.

trim dock
#

I have those redirects working using the Native InAppBrowser in Capacitor and handleActions: false option, so thats not so much of a problem.

cyan ice
#

The Payment Element is designed to be used on a web page, not in a web view in a Capacitor app.

trim dock
#

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?

cyan ice
#

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.

trim dock
#

Okay, that makes sense. So in order to use those methods, I should be creating the payment forms manually?

cyan ice
#

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.

trim dock
#

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.

cyan ice
#

Not sure how you would get that working in the app you're building.

cedar mauveBOT
trim dock
#

Just grabbing an example for you, will get back to you shortly.

keen saffron
#

Hi @trim dock I'm taking over this thread, let me know if you have any questions