#discorrduser_best-practices
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/1222978177207631984
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
The invoice.paid event would be sent when payment is actually successful so if that's when you're getting it that's when you know whether the payment is successful or not.
How are you creating your subscriptions? Is it through checkout? schedules? something else?
It's checkout
And I see the other platforms handles this in around 20 seconds.
Like OpenAI, and many more services does this really almost instantly
Do you have an example checkouut session I can take a look at?
Do you want a screenshot?
or code?
It's stripe checkout page
Something like this
The Checiout Session ID - like cs_test_123
where should I get that? Sorry, I'm still not getting you
Really I'm just trying to look at an Invoice or Subscription where you're seeing the 1 hour delay in getting the invoice.paid because I wouldn't expect that to happen
You should be able to find an invoice/sub ID in the dashboard
Hmm. So I meant actually, that event is triggered almost instantly
If you don't want to rely on invoice.paid you could instead use checkout.session.completed to know that the checokut session was paid for
But the status is updated to "paid" after "draft" in around 1 hours later
Is this for the invoice right after the checkoutu session is paid for? Or is this for a renewal invoice?
Above is for the subscription, the renewal invoices
So this was the story I was struggling.
I used "customer.subscription.updated" to know if the customer made updates on their subscription (renewal or new subscription)
And checked the latest_invoice paid stautus to know if they made actual payment
But in most cases of renewal, it was 1 hour later after "subscription.updated" event triggered
Ah, if you're talking about the renewal invoices then this is expected - when a renewal happens we first create the invoice in draft, wait an hour, and then automatically finalize it and attempt payment.
Yes. But now, I'm talking about new payment
"invoice.paid" event is instant enough?
What do you mean by "new payment" here?
(stepping in for karbi who needs to step away)
New payment means, the fresh new payment on our platform.
It's not subscription update or something.
It's just putting card numbers and CVV on this page
this.
What event should I listen or what's the approach to know if the payment of this user actually successful
The same event, invoice.paid , should also work, there is no 1hr draft delay for the first invoice of a new subscription
okay. good