#hooky-invoice-failure

1 messages · Page 1 of 1 (latest)

barren hedgeBOT
formal tide
#

More context: For most accounts everything works fine (we use Stripe Connect, we are a B2B). This is happening with only a couple accounts.

muted salmon
#

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)

formal tide
#

I'm not sure. Here's an example payment intent: pi_3MN4VzDxcWtM6ueJ1ITXwqrR

muted salmon
#

that's just a PaymentIntent

formal tide
#

Correct, and we do this:
const charges = await stripe.charges.list({ payment_intent: id }, { stripeAccount: accountId });

muted salmon
#

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

formal tide
#

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.

muted salmon
#

None of this

formal tide
#

ahhh I am re reading your msg sorry, looking for the event!

muted salmon
#

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 an invoice.payment_failed Event?

formal tide
#

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)

muted salmon
#

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

formal tide
#

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?

muted salmon
#

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?

formal tide
#

Yes, thank you! We can close this! Thanks a lot!