#k-nicholas_webhooks

1 messages ¡ Page 1 of 1 (latest)

pure lintelBOT
#

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

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

heady goblet
#

just adding extra detail: we dont see the last4 in the "checkout.session.completed" event. therefore we are making extra API call to stripe.checkout.sessions.retrieve()

azure edge
#

Can you share the id of the Checkout Session so I can see what other options you'd have here?

heady goblet
#
cs_test_a1dSGCEgshknkDmDvHLy4TC0FHeWIaUb7ahHPCCkT1CZF05bkQzjpCirT8
azure edge
#

Can you look at evt_3RyvatRx5jzmxTnn0f5VYYen and see if that works for you?

heady goblet
#

yeap, that "charge.succeeded" event have the last4 card number.

#

does that mean we need to listen to 2 event? whats the order of event?

azure edge
heady goblet
#

btw, is there rate limit per second or any limit that we should be aware for this API "stripe.checkout.sessions.retrieve()"

azure edge
#

Yes, we have rate limits: https://docs.stripe.com/rate-limits and we recommend that you listen to events and attain the data needed instead of making GET requests as you scale.

heady goblet
#

one last question. lets say we listen on both event "checkout.session.completed" & "charge.succeeded".

what is the common id between this two that we could "link" them. is it the payment_intent id (e.g: pi_3RyvatRx5jzmxTnn0Jducrsr). or is there another ID?

#

i dont see "client_reference_id" in there. or should we store in metadata. which will then be available on both event?

azure edge
#

yeah, you can use the pi_

heady goblet
#

btw i just notice that the metadata value is only populated on "checkout.session.completed", but not populated for "charge.succeeded" event

  • evt_1RywWtRx5jzmxTnn1HBUakj7
  • evt_3RywWsRx5jzmxTnn0db0sJxp
#

we set the metadata in "stripe.checkout.sessions.create()"

azure edge
heady goblet
#

sorry, thats what we just did. we added the metadata to "stripe.checkout.sessions.create()"

        const session = await stripe.checkout.sessions.create(
            {
                client_reference_id: cartId,
                metadata: {
                    cartId: cartId,
                },
...)

but thats not available on charge.succeeded event

azure edge
#

No, you need to set it payment_intent_data.metadata as well

heady goblet
#

opsss sorry my bad. missed the "payment_intent_data" bit

azure edge
#

No problem!

heady goblet
#

cool. that works. thanks for the help!

azure edge
#

Sure