#wim_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ 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/1284107332095315978
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
The parent subscription was canceled: https://dashboard.stripe.com/logs/req_QNrjzGtPf4IEfB
So we'll stop any automatic retries following that
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Oh okay, so it doesnt have anything to do with the payment method (paypal) right? Because that was our suspect at first
Don't believe so no, there was at least attempts to pay the invoice before the sub was cancelled:
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
So we did retry it, but then stopped
okay, then do you have an idea on how to handle such cases?
so we specifically just listen to the invoice.payment_failed as of now and have something like this on the webhook listener:
if (invoice.getNextPaymentAttempt() == null) {
overduePaymentService.saveOverduePayment(invoice, OverdueReasonEnum.FAILED_PAYMENT);
}
Handle what specifically?
well, due to canceling the subscription we lost our way of creating a overdue payment in our system
the thing is, that we keep subscriptions active or in overdue if payment fails, we dont cancel them immeditialy
we need to collect overdue payments so we can charge the customer, even if the payment via stripe failed
and in this case, the subscription was canceled manually, with that remove the customers access from our product
Not sure what you're asking me? You have logic that must cancel the subscription somewhere?
no, im sorry if im not explaining good
even tho the subscription was cancelled, i want to be able to run the logic, that would've run if there was an invoice.payment_failed event with nextPaymentAttempt: null
next_payment_attempt will never be null in invoice.payment_failed events I don't think
You're going to need to handle invoice.updated events which reflect the cancellation and next_payment_attempt: null
it does, we are using it
after 3 payments attempt the next invoice failed has null on next payment attempt
OK, but not in the scenario the sub is cancelled
Sorry overall I don't really understand what you're asking me
The subscription was cancelled, if you want to charge an overdue fee or whatever when perhaps you should listen to customer.subscription.deleted events and check to see if there are any open/overdue invoices for that subscription
Then run your logic
Okay, thanks for your input
I will check it out ๐