#gabgab_paymentelement-setupfutureusage-paymentmethods

1 messages ยท Page 1 of 1 (latest)

zenith gardenBOT
spiral rampartBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

zenith gardenBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1252289458972262482

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

fervent sparrow
#

Hi ๐Ÿ‘‹

What do you mean by "changes it's payment method"? Do you mean you are creating a new Payment Method object for the Customer?

hoary pagoda
#

I'm using the Stripe Payment Element, so when the user will click on card, click on Twint etc

fervent sparrow
#

Are you saving payment methods when you do this?

hoary pagoda
#

Currently I was saving it systematically but I was using card only.

#

Now I want to add Twint

fervent sparrow
#

If you want to save a payment method to be charged later then you need to include the setup_future_usage parameter. If you want your customers to enter their payment method details each time, you do not.

hoary pagoda
#

My point is this parameter is filtering eligible payment method that are shown on the widget

fervent sparrow
hoary pagoda
#

My target is to set setup_future_usage:true when the user will select the card, on to set setup_future_usage:undefined when he will select Twint. Then I guess I have to create the payment intent on the server before confirm the payment with this value.

That being said how should I handle the setup_future_usage parameter when I initialize Stripe Elements ?

fervent sparrow
#

It may be possible but this would be somewhat error prone.

You could instantiate you elements without specifying setupFutureUsage and this would display Twint as an option. Then, if the user selects a card payment method, you could upate the elements isntance with setupFutureUsage: "off_session".

This would hide Twint as an option so the customer could not switch back but it would allow you to present both.

hoary pagoda
#

Isn't there "good" pattern to mix payment methods supporting/not supporting setup_future_usage ?

fervent sparrow
#

Not that I am aware of currently.

hoary pagoda
#

Ok the fact the payment methods would not be static for the user and couldn't be reverted to the original state is kind a no go :).

Is there any UI widget to display on its own Twint as an independant widget?

fervent sparrow
#

Unfortunately not that I know of. We only recently added support for Twint and this appears to be a rough edge. I can flag support for both in same Payment Element as a feature request.

hoary pagoda
#

OK thanks it could help. But is there only this Twint payment method that would not support setupFutureUsage? My issue seems more generic: mixing payment method that support it with other that doesn't

fervent sparrow
#

I'm not aware of a specific set of payment methods that would be blocked by setupFutureUsage but we are adding payment methods pretty fast and I think it would be a good thing to support in general.

hoary pagoda
#

Just to be sure, could you please just confirm currently I can only support Twint (client side) using the Payments element? Isn't there any other alternative, (almost) whatever codes it would imply client side?

fervent sparrow
#

The only other alternatives would be involving Checkout. And the payment page for Stripe Checkout uses the Payment Element. We don't have a separate element that could be used to render just Twint.

hoary pagoda
#

Is there anywhere I can follow your flag or it is just an internal backlog?

fervent sparrow
#

You can write in to Support to ask about support for both types of payment method and they should be able to find the internal ticket and keep you updated if/when it gets selected for development.

hoary pagoda
#

ok thanks for help

fervent sparrow
#

Okay, feedback filed

hoary pagoda
#

thanks

fervent sparrow
#

Happy to offer what help I can ๐Ÿ™‚