#DamManc

1 messages ยท Page 1 of 1 (latest)

barren waspBOT
storm sky
#

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?

burnt crypt
#

Yeah for sure! "subscription": "sub_1LmdZbGbpWQ4NfkI0znuYPTd",

storm sky
#

Thanks, pulling that up.

burnt crypt
#

in my webhook i have invoice.payment_failed

storm sky
#

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

burnt crypt
#

thank you! as soon as possible i'll try!

storm sky
#

Sounds good! Let us know if that doesn't work.