#mattbevis_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/1382690859727978568
π Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! looking into this now. can you explain what you mean by you trying to access the receipt_url but it coming back as null?
the receipt_url is definitely present, but are you trying to scrape the URL or something along those lines?
but if you look at what gets returned fo that charge obect its null
not receipt url reciept number
sorry I miss typed
gotcha. i know we only generate a receipt_number when a receipt email is actually sent, so let's check if an email was sent
ok...
hmm yep the email receipt was sent, so let me see what else could be going on here
the mystery continues π
just double checking, it sounds like this happens consistently for you?
yep
what happens if you do a GET on the charge now?
how can I do that
using this API:
https://docs.stripe.com/api/charges/retrieve
one quick way to do it would be to copy the CURL request into something like Postman
gotcha
i think the root of this might be that the receipt email is sent after the charge succeeds, so you get a snapshot of what the charge looks like before the email is sent
which would mean the number isn't generated yet. but let's see what you get from that GET request first
nope, it looks like you're just experiencing a known issue that i was just able to find. essentially the problem is that this order of events happens:
- the charge succeeds - webhook event generated
- the receipt URL is added - webhook event generated
- the email is sent
- the receipt number is added - NO webhook event generated
:/
ideally we would send you a second updated event but we don't currently
so is there a work around in which I can always get the number
the workaround is to do a GET request shortly after you get the updated event because we should generate the number pretty quickly
but if you want i can create a case for you so you can be notified when we fix the root of the problem
a get request after the chare.updated event?
yep... let me double check if there are best practices around the timing, gimme just a bit
hmm it looks like we sent the email 10 seconds later in this case
what exactly do you need the receipt number for?
doing a GET right after the charge.updated event would have still resulted in a null in this case, so the best way to go about this might depend on what you need it for
I show it to the customer in a table
if you need it as soon as possible you could poll for it with some kind of backoff until the receipt_number is present, which is a little icky. or if you just need a daily pull of receipt numbers you could use the list API in a batch process
gotcha. yeah in that case i don't think there's a super elegant solution, i think polling is your best bet
i ran it by another person on my team to get their thoughts and they said the same thing
but in the meantime let me send you a link to where you can create a case, i'll then attach the case to the bug and our support team can let you know when it's resolved
Hello @iron frost, we have sent you a direct message, please check it at https://discord.com/channels/@me/1382700016375955587
- πThe message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.