#egli_invoice-events
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- egli_webhooks, 18 minutes ago, 3 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1272926123751116882
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
def stripe
event = Stripe::Event.construct_from(params.as_json)
case event.type
when 'invoice.paid'
handle_invoice_paid(event.data.object)
when 'invoice.marked_uncollectible'
handle_invoice_uncollectible(event.data.object)
when 'invoice.overdue'
handle_invoice_overdue(event.data.object)
when 'invoice.payment_failed'
handle_payment_failure(event.data.object)
when 'invoice.voided'
handle_invoice_void(event.data.object)
end
head :ok
end
for past due i added thsoe events, also invoice.updated but nothing
Hi there ๐ can you share the ID of an Invoice from your testing?
yes 1 min
egli_invoice-events
in_1PkpGhARjJ1na9ElzcvOQ23T
Also on events im not seeing and status change, only finalized
Stripe::Invoice.create(
customer: customer.customer_stripe_id,
auto_advance: false,
collection_method: 'send_invoice',
due_date: 30.days.from_now.to_i
)
JUst to mention that our logic is using send_invoice not automatic way
Thank you for the additional context, I'll need a couple minutes to take a closer look.
Ok Thanks
It looks like there isn't a good Event type to listen for to get notified when an Invoice becomes past due, because that doesn't get reflected in the API object as a status or in any other field on the Invoice object.
To accomplish what you're after, you'll need to use Billing Automations:
https://dashboard.stripe.com/settings/billing/automations
This will allow you to specify that the invoice.overdue Event should be generated and sent, which you can then listen for in your webhook endpoint.
Similar to what is described here, but without the amount threshold, and using "send webhook" instead of "email team member"
https://docs.stripe.com/billing/automation-recipes#invoice-overdue-notifications
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.