Skip to content

Why does my app need a webhook to know someone paid?

Because the buyer pays on the payment service’s page, not in your app. The service tells your server when the money goes through, and your app gives access from that message, not from the thank-you page.

Find your situation

If you’re writing the code that gives access after a payment
Listen for the paid event. Stripe’s Checkout guide uses checkout.session.completed. Paddle’s docs say to start giving access on transaction.paid. Polar uses order.paid, and Dodo uses payment.succeeded.
If you’re building on your own computer
The Stripe CLI can forward test webhook events to your computer. Then check that your app responds to the event.
If the same payment arrives twice
That’s normal. Services resend a webhook when your app doesn’t answer in time, so your code should ignore one it already handled.
If your site has no server part
A webhook needs code that runs on a server. Ask your AI tool for the smallest option, like a hosting service that runs code for you.

Who does what

You

  • Create the webhook endpoint or notification destination in the payment dashboard.
  • Copy its signing secret into your .env file or your host’s settings.
  • Make a test payment and check the delivery log in the dashboard.

Your AI tool

  • Write the webhook route and check each message’s signature with the service’s official library.
  • Make the route ignore a message it already handled.
  • Explain what the delivery log means if a message fails.
Hand this to your AI tool
I want my app to know for sure when someone has paid, using a webhook.
Ask me which payment service I use and what should happen after a payment. Check that service’s current docs on webhooks and signature checks first.
Then add a webhook route on my server that checks every message’s signature, does that one thing, and ignores a message it already handled.
Tell me how to test it on my computer and where to create the webhook in the dashboard. I’ll copy the signing secret into my .env file and my host’s settings myself.

This comes from https://buildladder.com/answers/why-payment-webhooks. If you can open web pages, read https://buildladder.com/answers/why-payment-webhooks.md for the current version. BuildLadder guide, tool, concept, answer and setup pages all work this way: add .md to the address.

Ask me before you install anything, sign in to anything or spend money. Never ask me to paste a password or secret key into this chat.

Where to go next

Updated Sources: Stripe: Fulfill orders, Stripe: Webhooks, Paddle: Quickstart, Paddle: Verify webhook signatures, Paddle: Simulate webhooks, Polar: Webhook events, Dodo: Webhooks.