Plan a Stripe integration around webhooks, failed payments and refunds, not only the pay button, with clear ownership of your account.
The short answer
What does a Stripe integration need beyond a pay button?
A webhook endpoint that verifies Stripe's signature, handles duplicate and out-of-order events, and answers quickly. Also plan failed payments, refunds and what staff see when something goes wrong.
A concept of verified webhook intake vs. idempotent record writes.
From
Stripe event
Reads
To
Your webhook endpoint
Writes
Server creates session with internal order reference and amount.
DoneCustomer completes card or bank check; return URL shows status only.
DoneEndpoint checks Stripe-Signature header and replies 2xx immediately.
NowWorker updates order once, handles refunds and failed renewal retries.
NextSource: Receive Stripe events in your webhook endpoint (Stripe)Checked
Source: Receive Stripe events in your webhook endpoint (Stripe)Checked
Source: Receive Stripe events in your webhook endpoint (Stripe)Checked
Source: Receive Stripe events in your webhook endpoint (Stripe)Checked
export async function postStripeWebhook(rawBody: Buffer, sig: string) {
const event = stripe.webhooks.constructEvent(rawBody, sig, process.env.STRIPE_WEBHOOK_SECRET!);
const recorded = await db.stripeEvents.insertIgnore(event.id);
if (recorded) await queue.enqueue("stripe-event", { id: event.id, type: event.type });
return { received: true };
}Facts reviewed as of
Tell us what you sell, how you bill and what happens after a payment.