#alexander-1966_api

1 messages ¡ Page 1 of 1 (latest)

proud burrowBOT
#

👋 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/1265319589835702273

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

graceful shadow
acoustic pecan
#

Thanks. So I assume there's no other way to achieve that?

graceful shadow
#

nope, you'll have to copy the metadata manually in code. What are you trying to do?

acoustic pecan
#

I'm trying to distinguish webhooks for charge.* and payment_intent.* for subscriptions from non-subscription events

proud burrowBOT
acoustic pecan
#

such webhooks have an invoice association invoice: in_... that I can fetch expanding the subscription - and from there find that out

#

I was hoping there's be a more elegant way for that but seems like no

graceful shadow
#

the PaymentIntents or Charges will have a non-null invoice field so you wouldn't need to expand it to know it belonged to an Invoice, right?

#

or do you have one off Invoices also and you're trying to distinguish "one off Invoices" vs "Sub backed Invoices"

acoustic pecan
#

trying to distinguish "one off Invoices" vs "Sub backed Invoices"
yes, that

lone steeple
#

One easier way could be to listen to the invoice.paid event which will have info on whether it is one-off or part of a subscription.

acoustic pecan
#

yeah. Problem is we already have listeners for charge.* and payment_intent.* events that need to ignore subscription-related ones (and handle the others)

#

so that distinction has to be made there

#

anyway, thanks for checking that, I don't have any other questions