#Ian Kaplan-subscription-default-pm

1 messages · Page 1 of 1 (latest)

hollow hearth
#

Hello! Is this a custom integration or are you using Checkout?

#

Sorry, you said Payment Element 🤦

wispy spindle
#

ok do you recommend doing that on a webhook event?

hollow hearth
#

Hmm, you could do. Just not sure which event would be best suited for that 🤔

#

Where you'd need both the Subscription object ID and the Payment Method object ID

#

I think that's likely why that document recommends doing to synchronously in your server-side code. There's likely not a single event that fits the requirements

wispy spindle
#

found it. it says listen to the invoice.payment_succeeded event

hollow hearth
#

Ha, not sure how I missed that 😆

wispy spindle
#

hah

#

a

#

it would be nice when confirming a payment intent it set the default payment method if one didnt exist

#

my question would then be do you know what happens if a subscription invoice fails, my customer then confirms that paymentIntent with a different card to pay the invoice and restore the active subscription status, I assume the default_payment_method would not be changed and they would be charged on the bad card again the following month?

#

unless i set the default payment method again