#defpearlpilot

1 messages · Page 1 of 1 (latest)

exotic daggerBOT
elfin marsh
dawn solar
#

Is there a runaway loop in one of your webhook handlers maybe?

#

Or maybe a circular dependency that might cause your internal logic to recursively make API calls?

elfin marsh
#

what appears to be happening is we get an update, it fails to pay, we get an update that if failed to pay. so we try to pay it again, and so on.

#

the one thing i do want to draw attention to is the spamming of emails in this loop. where is the limit on failed attempts enforced? if we've exceeded that, should we no longer get any invoice updated webhooks?

#

i know that via your console, it's configured to 4 attempts to collect.

#

but i'm not sure if that's just your automations versus something the system enforces

dawn solar
#

where is the limit on failed attempts enforced? if we've exceeded that, should we no longer get any invoice updated webhooks?
I don't understand what you're asking here. Can you rephrase?

elfin marsh
#

what i mean is that there should be a system limit on how many times you can attempt to collect payment on an invoice. for example, on a subscription cycle it attempts to collect 4 times and may mark the subscription as uncollectable.

dawn solar
#

You set that limit in the Dashboard using the link I sent you

elfin marsh
#

but our webhook tried to collect payment for the cycle but it clearly tried more than 4 times

dawn solar
#

So that should be the limit, unless they update their payment method, then the limit starts over

elfin marsh
#

we've had that set for a while

#

it seems like that limit is not system enforced

dawn solar
#

I only see 4 failed payments in the screenshot you sent. Can you send an Invoice Id that I can look at?

elfin marsh
dawn solar
#

It looks like you're calling the API to try and pay that Invoice a bunch. Stripe will stop auto-retrying payment attempts, but you can still try to pay the invoice. We don't stop you from doing that.

What are you trying to do?

elfin marsh
#

ok, that's good to know. we were trying to collect payment on invoices that we generated either manually or through prorations. and we noticed this happened on payments that stripe attempts to collect automatically, namely subscription_cycle as the billing_reason. we've stopped trying to pay on those so we shouldn't have this behavior anymore.

#

are there any other billing_reason types that we shouldn't try to collect on so we can get ahead of potential problems?

dawn solar
#

I'm not really sure. Why are you using it to begin with?

elfin marsh
#

in some cases, we noticed that even if we have auto_advance set to true, stripe didn't attempt to collect even thought the invoice state went to open

dawn solar
elfin marsh
#

yes, we set that to "CHARGE_AUTOMATICALLY" and we recently set a payment method

dawn solar
#

I think if you set charge_automatically before you have a valid Payment Method, then it will not auto-advance, so in that case you would just need to detect when a new payment method is created and then check if that customer has any outstanding Invoices. You would just look at the status of the Invoice instead of billing_reason

elfin marsh
#

ah ok

#

so if there are any outstanding invoices then it will not auto advance?

dawn solar
#

Not if there is no Payment Method to use

elfin marsh
#

ok