#Deathnfudge

1 messages ยท Page 1 of 1 (latest)

toxic lotusBOT
fair ibex
#

Hi ๐Ÿ‘‹

So are you trying to attach the default source at the time you create the checkout session?

#

SInce these are legacy payment methods?

#

Or would it be acceptable to attach them after the initial subscription is set up?

karmic barn
#

We could do it either way. Ideally we would handle it when the initial subscription is set but we can also handle it after the fact.

A bit more context: We want to keep the existing flow to allow customers to update quantity (seats) on their subscription. We're switching to use the Customer Portal for most updates but because we can't send customers straight to the "update seats" part of the billing portal and we have the existing flow, we wanted to keep that working until we can send customers directly to the "update seats" part of the billing portal.

Since we're working toward eliminating the old Elements code, we don't really want to add new code (Payment Intents) to the old workflow so we'll only allow upgrading with the old flow for customers using Card sources but don't see a great way of getting the card source for creating charges. I'm up for any good way of handling either setting the default source or getting the source in order to use for Charge payments.

fair ibex
#

Okay so in that case I would suggest you listen for the subscription.created or checkout.session.succeeded event and then make an update to the subscription that sets the default_source parameter.
https://stripe.com/docs/api/subscriptions/update?event_types-payment_intent.payment_failed#update_subscription-default_source

karmic barn
#

Ok. I'll check that out. We're already handling the checkout.session.succeeded event, so that'll probably be the way to go. Thanks!