#_webhooks

1 messages ¡ Page 1 of 1 (latest)

indigo shoreBOT
#

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

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

timid zenith
#

1 Checkout Session generates 1 Subscription, but then generates a lot of Invoice and Payment Intent on each billing cycle. If you want to include the metadata in each generated Payment Intent, you would want to listen to invoice.paid everytime, take the metadata from the Subscription, then manually set it to the linked PaymentIntent object

coarse moth
#

Do you mean that by obtaining the metadata from the invoice.paid webhook and then updating it via the PaymentIntent update API, it will be applied to the Charge object?

#

But I cant get payment intent ID in invoice object

timid zenith
#

If you want the metadata on Charge object, you would want to call Update Charge API

#

metadata is on object level

coarse moth
#

Workflow is it?

  1. checkout session set subscription metadata
  2. receive metadata in invoice.paid webhook
  3. get payment intent ID in invoice.paid webhook
  4. update payment intent object (metadata) in invoice.paid webhook
timid zenith
#

Yes steps are correct. "receive metadata" in invoice.paid webhook means receiving metadata from the Subscription object

#

You may need to call Retrieve Invoice API and expand subscription, because step 1 only can set the metadata to the Subscription object so far