#jfcalvo
1 messages ยท Page 1 of 1 (latest)
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
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)
Sure, you'd use this endpoint and param: https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Perfect. Thank you very much for your time!
๐ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
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?
could you please elaborate?
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?
unfortunately there isn't
What is the common approach for these cases?
I guess this is something very common to avoid problem with recurring payments
there's another way of achieving this
What people usually do to set the default payment?
but it won't be saved on the customer but instead on the subscription
I see
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
How is that done?
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
Ok, let me take a look