#defpearlpilot
1 messages · Page 1 of 1 (latest)
It sounds like you're hitting our rate limits because your integration is sending too many API requests at once: https://stripe.com/docs/rate-limits#object-lock-timeouts
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?
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
You should probably disable emails while you get this figured out in that case: https://dashboard.stripe.com/settings/billing/automatic
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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?
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.
You set that limit in the Dashboard using the link I sent you
but our webhook tried to collect payment for the cycle but it clearly tried more than 4 times
So that should be the limit, unless they update their payment method, then the limit starts over
I only see 4 failed payments in the screenshot you sent. Can you send an Invoice Id that I can look at?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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?
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?
I'm not really sure. Why are you using it to begin with?
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
You may want to dig into that more. Are you also setting collection_method? https://stripe.com/docs/api/invoices/object#invoice_object-collection_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes, we set that to "CHARGE_AUTOMATICALLY" and we recently set a payment method
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
Not if there is no Payment Method to use
ok