#DramaLlama-set-default-pm
1 messages · Page 1 of 1 (latest)
Hey! It all depends on how you created the Setup Intent. If you pass the customer parameter, the resulting PM will be attached
To set it as the default then you'll need to make a subsequent API call, yes: https://stripe.com/docs/billing/subscriptions/build-subscription?ui=elements#default-payment-method
aha, if I already have a subscription and add a payment method and send in the customer parameter so it becomes customer standard. If the subscription then does not have any standard payment at all, will it then be used for payments on the subscription
basically, will it go up the tree to customer and check for default PM?
Ah wait I misread your answer upi kist said it will be attached, so I need a second api call
Then my question instead is. Can I get a callback webhook when a setup intent is successful and there now exists a new PM
Yes, if there's no default_payment_method set on the Subscription then it'll fallback to the invoice_settings.default_payment_method on the associated Customer object. Alluded to here: https://stripe.com/docs/api/subscriptions/object#subscription_object-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.
Yep, listen for setup_intent.succeeded events. Object will include the associated Payment Method ID: https://stripe.com/docs/api/events/types#event_types-setup_intent.succeeded
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Excellent, thanks for all the help!
Have a great day!
Np!