#hooky-invoice-failure
1 messages · Page 1 of 1 (latest)
More context: For most accounts everything works fine (we use Stripe Connect, we are a B2B). This is happening with only a couple accounts.
hooky-invoice-failure
@formal tide was there any Charge created? Or just a failed payment on an Invoice (which can happen if no payment method is being saved)
I'm not sure. Here's an example payment intent: pi_3MN4VzDxcWtM6ueJ1ITXwqrR
that's just a PaymentIntent
Correct, and we do this:
const charges = await stripe.charges.list({ payment_intent: id }, { stripeAccount: accountId });
You can look all of this up yourself! Look at the Event you are referencing and check whether a Charge happened or not. I'm assuming you are getting an invoice.payment_failed Event and that Event would have charge: 'ch_123' or charge: null
Looking now
Ok I loaded my dashboard and selected this account, what am I looking for? If I search the payment intent in question I see a timeline, of failed payments, etc.
None of this
ahhh I am re reading your msg sorry, looking for the event!
you're the developer, you said
if a payment fails right after finishing a Trial Period something goes wrong
Doesn't that mean you have a webhook handler that gets aninvoice.payment_failedEvent?
Yes, I'll look for an event id example. One sec!
Ok, found the event, let me see...
"charge": null,
The event contains that.
(another developer is telling me it may be the case that these customers were in a "weird" 3DS state... I can ask them to clarify if needed)
okay so in most cases this means there was no real payment, usually because the customer doesn't have any saved payment method for example
Cool cool. Additional question, as we're investigating this... When creating a checkout session, if one uses mode=setup instead of mode=subscription, could this be the cause for charges not being created when Trial ends? Because customer added a payment method, but didn't really attach it to the subscription or set it as default?
My doubt is... if they only have one payment method, doesn't it get used automatically? or even in that case it's needed to be marked as default payment method?
or even in that case it's needed to be marked as default payment method?
correct! That's most likely your issue. You saved a payment method but never marked it as default so we can't use it for future invoices
@formal tide does that unblock you?
Yes, thank you! We can close this! Thanks a lot!