#jfcalvo

1 messages ยท Page 1 of 1 (latest)

lyric adderBOT
dusky viper
#

I assume you're using Setup Intents?

#

Payment Element won't set the generated PM as the default no, so there'd likely be an additional API request to set that depending on your integration

marsh bison
#

Yes, using Setup Intents

#

What is the easier way to do that additional API request?

I'm allowing users to add multiple cards so maybe adding the last one as the default payment method?

#

(That last added card I mean)

dusky viper
marsh bison
#

Perfect. Thank you very much for your time!

sinful rivet
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

marsh bison
#

I have another question. I'm creating the customer before doing anything related with cards or payments. It is possible to set some "policy" about default payments when the customer is created?

sinful rivet
#

could you please elaborate?

marsh bison
#

My problem is that Setup Itents with Stripe Elements for adding new cards for customer is not setting the default payment method

#

So once a customer is adding a card and tries to pay for something the request fails with because there is not a default payment method

#

You colleague told me that an additional request is needed to set the card as default

#

My question is, there is an alternative way to set a different "policy" for a customer like "set the last card as default payment" instead of doing an specific and explicit request by customer?

sinful rivet
#

unfortunately there isn't

marsh bison
#

What is the common approach for these cases?

#

I guess this is something very common to avoid problem with recurring payments

sinful rivet
#

there's another way of achieving this

marsh bison
#

What people usually do to set the default payment?

sinful rivet
#

but it won't be saved on the customer but instead on the subscription

marsh bison
#

I see

sinful rivet
marsh bison
#

How is that done?

sinful rivet
#

using this param

#

you can set it to on_subscription

#

and at that point if you want you can get the payment method ID and save it on the customer object as discussed previously with my colleague

marsh bison
#

Ok, let me take a look