#JoeAdroit - Automatic + Setup

1 messages ยท Page 1 of 1 (latest)

cerulean bay
#

HI ๐Ÿ‘‹

#

What API are you referring to?

sinful narwhal
#

Stripe PHP

#

PaymentIntent

cerulean bay
#

Okay there we go. What are you using on the front-end to collect payment method details?

sinful narwhal
#

stripe.elements

cerulean bay
#

Okay so you can use that configuration but it will restrict the available payment methods to ones that can be used for recurring payments

sinful narwhal
#

That's what I'm seeing. E.g. Klarna not available if I add future_usage. To make work, I'm updating the intent later with future usage, but if they choose Klarna, I notice log error on Stripe of failed update. I guess I can check payment method and not update

cerulean bay
#

Well if you know you want to use the future usage approach, then why not set it up front and restrict the choices?

sinful narwhal
#

Restrict the payment options like Klarna?

hallow ether
#

๐Ÿ‘‹ Hopping in since @cerulean bay has to head out soon

#

Yeah Klarna is not a Payment Method type that can be used with setup_future_usage at all - what is your intended goal here? To allow Klarna on the PI (but not save the Payment Method for future usage) and have that work with other PM types as well (like card which sould saved the PM type)?

sinful narwhal
#

Exactly!

hallow ether
#

Gotcha! So what you can do is continue to set setup_future_usage top-level, but you ALSO need to set payment_method_options.klarna.setup_future_usage: none (see https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-klarna-setup_future_usage). This will turn off setup_future_usage if the customer chooses to pay with klarna