#mboras_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/1357634137946853530
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
if you are using Checkout Session, then yes checkout.session.completed is the correct event
we have a full guide about this: https://docs.stripe.com/checkout/fulfillment
one more question please
what type is request object that I am receiving in my webhook for checkout.session.completed (typescript) and I am using package stripe
you will get a Checkout Session object in the payload.
yeah I am getting it all good, but I am asking does Stripe package have some predefined type in typescript that I can use
I think I've found it
import Stripe from "stripe";
type CheckoutSession = Stripe.Checkout.Session;
type StripeEvent = Stripe.Event;
...
const body = (await req.json()) as StripeEvent;
const session = body.data.object as CheckoutSession;
console.log("Checkout session completed:", session);
console.log("Complete Stripe webhook object:", JSON.stringify(body));
I think this'll be it
yes that looks right!
tnx @digital gate very much