#Carlos M - Default PM
1 messages · Page 1 of 1 (latest)
Hi there! You can either (a) set the default_payment_method on the Subscription itself, or (b) set a payment_method on the Customer
If you do both, the payment_method attached to the Subscription will take precedence
but how to capture card data for trial subscriptions?
So I don't need to ask for the data in the future.
You can collect the payment method with any of our supported collection methods and then set the default_payment_method property of the payment method ID that you create through that process https://stripe.com/docs/payments/save-and-reuse
Subscriptions actually have a pending_setup_intent property with a setup intent you can use to collect the info https://stripe.com/docs/api/subscriptions/object#subscription_object-pending_setup_intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok
thanks
If the customer changes payment method because the other one failed, how do I identify that the old payment method was changed to a new one?
If you are setting this as the default payment method on the subscription, I believe you should get a customer.subscription.updated event
if the customer changes cards, is the payment_method changed?
I can compare the current default payment method with the old one, if it is different I set a new default
correct?
personalized
If it is a card, you can check the payment method's card.fingerprint property and see if it matches with the payment method that you already have on the subscription
ok