#evan_best-practices

1 messages ¡ Page 1 of 1 (latest)

green prismBOT
#

👋 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/1247244720938291224

📝 Have more to share? Add details, code, screenshots, videos, etc. below.

azure ember
#

You have to explicitly set it in some most cases. The default can either be set on the Customer object or the Subscription object

heady mortar
#

understood, is the best way to listen for payment_method.attached events, assume the latest updated method is the default, and attach to the customer/subscription?

azure ember
#

That's a way to do it yes. Often times folks will have a radio button for the customer to toggle that says something like "Set this payment method as default on all subscriptions and invoices"

heady mortar
#

would that be with a custom field in the checkout session or something?

azure ember
#

No. That would be somewhere in the form where you present the Customer with all their saved paymetn methods. If you're just using checkout sessions and nothing else, then you may as well just set the pm as default as soon as it's created, like you said

heady mortar
#

ah understood, yeah we don't have a payment method screen yet and just use the customer portal link for them to manage their payment methods

#

so we'll just set it as the default, and make sure that any changes in the customer portal are respected as well

#

thanks for the help!