#william-invoice-paymentfailed
1 messages ยท Page 1 of 1 (latest)
@mild wigeon hello! If an Invoice is in draft it can not be paid. It has to be finalized first.
And if you want to test invoice.payment_failed then the only way is to pay that Invoice with a card that would decline such as any of those: https://stripe.com/docs/testing#declined-payments
Right yeah makes sense, so I tried to do that with the declined payments test cards, i was unable to add any of the cards as a payment method because they get declined
I also tried the decline after attaching card, which successfully attached, but caused a payment_intent. payment_failed rather than an invoice.payment_failed event
Do you have a concrete example of that second sentence? Because I'm confident that would never happen and if you get payment_intent.payment_failed you get invoice.payment_failed too
william-invoice-paymentfailed
those are just pictures
Can you share one exact id of an Invoice where you had payment_intent.payment_failed but not the Invoice one?
It looks as though the payment_intent is not attached to an invoice
I've been trying to simulate a payment failing for a subscription. The subscription has a 14 day free trial so payment information is not collected up front. I've been using checkout to create the customer and subscription, then using the customer portal to input the 'decline after attaching' card details. Then in the dashboard I edited the subscription free trial to have a duration of 0 days to trigger the payment. What would be a better way to test the payment failing?
1/ Create a Subscription with payment_behavior: 'default_incomplete' and no trial
2/ Attempt to pay the PaymentInent associated with that Subscription's Invoice and see it all work as expected
How should I create the subscription with payment_behavior: 'default_incomplete'?