#mattbevis_webhooks

1 messages Β· Page 1 of 1 (latest)

inner brookBOT
#

πŸ‘‹ 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.

magic cargo
#

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?

iron frost
#

but if you look at what gets returned fo that charge obect its null

#

not receipt url reciept number

#

sorry I miss typed

magic cargo
#

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

iron frost
#

ok...

magic cargo
#

hmm yep the email receipt was sent, so let me see what else could be going on here

iron frost
#

the mystery continues πŸ˜„

magic cargo
#

just double checking, it sounds like this happens consistently for you?

iron frost
#

yep

magic cargo
#

what happens if you do a GET on the charge now?

iron frost
#

how can I do that

magic cargo
#

one quick way to do it would be to copy the CURL request into something like Postman

iron frost
#

gotcha

magic cargo
#

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

iron frost
#

that get req returns the number

#

so does that mean im using the wrong event

magic cargo
#

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:

  1. the charge succeeds - webhook event generated
  2. the receipt URL is added - webhook event generated
  3. the email is sent
  4. the receipt number is added - NO webhook event generated
iron frost
#

:/

magic cargo
#

ideally we would send you a second updated event but we don't currently

iron frost
#

so is there a work around in which I can always get the number

magic cargo
#

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

iron frost
#

a get request after the chare.updated event?

magic cargo
#

yep... let me double check if there are best practices around the timing, gimme just a bit

iron frost
#

if you could create a case that would be awesome as well

#

thanks

magic cargo
#

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

iron frost
#

I show it to the customer in a table

magic cargo
#

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

iron frost
#

mmmm lemme give it some thought

#

thanks for assistance

magic cargo
#

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

inner brookBOT
#

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.