#DamManc
1 messages ยท Page 1 of 1 (latest)
Hi there ๐ the 4242 test card should succeed payments, can you share the Subscription ID (sub_xxx) of the Subscription that you were using for testing?
Yeah for sure! "subscription": "sub_1LmdZbGbpWQ4NfkI0znuYPTd",
Thanks, pulling that up.
in my webhook i have invoice.payment_failed
Alright, so based on what I'm seeing, I think those payments are failing because the system isn't finding a default Payment Method to use.
When trying to automatically process a payment for a Subscription, we first look on the Subscription object to see if a default_payment_method was defined, and if not we try to fall back onto other records to find a suitable Payment Method. The order is described in the description here:
https://stripe.com/docs/api/subscriptions/object#subscription_object-default_payment_method
I see you created a couple Payment Methods for your Customer, but it doesn't look like any are set as the default for Invoices.
Could you try updating your Customer's invoice_settings.default_payment_method by setting it to the Payment Method ID (pm_XXX') of the Payment Method that you would liked to be used as the default for this Customer and then try your flow again:
https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-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.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thank you! as soon as possible i'll try!
Sounds good! Let us know if that doesn't work.