#thomasst - Payment Failure
1 messages · Page 1 of 1 (latest)
Hi there
All the information you want is in the event object itself
Well...you do have to do a little digging
Wait..there were no payment attempts on this invoice.
It was finalized, updated, and voided at the same time
If there were no payment methods, why would I get a invoice.payment_failed event in the first place?
Besides, we did try to charge, and on the payment intent it says "in_0LdHZC4rOYBvHyzsL2S2Ef9N's payment for an invoice for $20.95 USD failed9/1/22, 1:52:42 PM"
If you look at the activity of https://dashboard.stripe.com/payments/pi_2LdHZE4rOYBvHyzs0xD6A0oo
Nope, no attempts
There are no charges associated with that PI
and the only modifying API requests are for invoice finalizing, invoice updating, and invoice voiding
Why was the invoice.payment_failed webhook fired then?
Hmm this isn't the whole story, looks like we tried to pay it after all: https://dashboard.stripe.com/logs/req_H7J3ZIAa2bG6jZ
At the time of the charge the customer should have a credit card on file, no?
(There is an ACH method on the account but that one was created later via evt_0LdJwZ4rOYBvHyzsrZAMJ3q7)
looking
having a card on file is not enough, for the Pay Invoice API to work without saying which PaymentMethod to use, you have to set a specific PaymentMethod as the default for Invoices. This is done via https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
if this isn't set, we don't know which PM to use.
Alternatively you can be explicit and specific which PaymentMethod to use when you call https://stripe.com/docs/api/invoices/pay
As in, I either need a default payment method, or specify it explicitly?