Paddle vs Dodo Payments: Live Site Integration Guide
How to wire Paddle or Dodo Payments into a live site: payment links, overlay checkout, webhook verification on Cloudflare Workers, and costly mistakes.
I have now wired payments into a live site twice. The first time I planned everything around Paddle. On this site, I ended up on Dodo Payments. Both are good products. Both are a Merchant of Record. And both will happily take your money and your customer's money if you wire them up wrong.
This guide is the version I wish I had on day one: what each one actually is, how the checkout and the webhook work, the code I would put in a Cloudflare Worker, and the mistakes that quietly cost sellers money. No theory for the sake of it. If you sell digital products or a small SaaS to buyers in the US, UK, EU, Canada or Australia, this is for you.
First, what "Merchant of Record" really means for you
When you use a plain payment processor, you are the seller. You collect the money, and you are on the hook for VAT in Europe, GST in Australia and India, and sales tax in the US states where you cross a threshold. For a one-person business, that paperwork can cost more than the product earns.
A Merchant of Record flips that. The provider legally resells your product. Their name is on the invoice, they calculate and pay the tax, and they deal with refunds, fraud and chargebacks. You get paid out what is left. That is why the fee is higher than a plain processor: you are paying for the tax and compliance work, not just card processing.
Paddle and Dodo Payments both work this way. Dodo describes itself as handling payment processing, invoicing, taxes, refunds and disputes on behalf of the businesses on its platform. Paddle sells the same idea under the line "Paddle is the seller."
Paddle vs Dodo Payments at a glance
Here is the side-by-side I use when someone asks me which one to pick. Prices are the published headline rates as of November 2026. Always open the provider's own pricing page before you decide, because extra charges for currency conversion, payouts or certain payment methods can change the real number.
| What matters | Paddle | Dodo Payments |
|---|---|---|
| Legal role | Merchant of Record | Merchant of Record |
| Headline fee | 5% + 50¢ per checkout transaction | 4% + 40¢ (US domestic, per Dodo's published rate) |
| Monthly fee | None | None |
| No-code option | Hosted checkout and payment links | Payment links: checkout.dodopayments.com/buy/{product_id} |
| In-page checkout | Paddle.js overlay or inline | dodopayments-checkout overlay or inline |
| Server-created checkout | Transactions API | POST /checkouts (single-use URL, 24-hour expiry) |
| Webhook signature | Paddle-Signature: HMAC-SHA256 of ts:body | Standard Webhooks: webhook-id, webhook-timestamp, webhook-signature |
| Test environment | Sandbox account and sandbox keys | Test mode keys and test.dodopayments.com |
The fixed part of the fee matters more than people think. On a $10 product, Paddle's 50¢ alone is 5% of the price, so the effective fee is about 10%. Paddle also asks sellers of products under $10 to contact them about custom pricing. On a $299 licence it hardly matters. If most of your catalogue sits under $30, run the numbers on your real prices before you choose.
The one rule that saves you from 90% of payment bugs
Never unlock anything because the buyer landed on your "thank you" page. A redirect URL is just a URL. Anyone can type it, share it, or reload it. Dodo even appends payment_id, status and email to your redirect, which makes it tempting to read status=succeeded and hand over the file. Don't. Dodo's own integration guide says to fulfil from the webhook, not the redirect, and Paddle works the same way.
The flow that holds up in production looks like this:
- The buyer clicks Buy and goes to a hosted checkout. Card details never touch your server.
- After payment, the buyer is redirected to a page that says "Thanks, your access is being unlocked."
- Separately, the provider calls your webhook endpoint with a signed message.
- Your server checks the signature and the timestamp, records the event ID so it only runs once, and then grants access.
- Refund or chargeback events take that access away again.
Integrating Dodo Payments on a live site
Dodo gives you three levels. Start with the simplest one that does the job and move up only when you need to.
Level 1: payment links (no code)
Create the product in the Dodo dashboard and you get a link in the form https://checkout.dodopayments.com/buy/pdt_.... You can add query parameters: quantity, redirect_url (note: not return_url), pre-fill fields such as email, and your own metadata_* values. Put that link behind your Buy button and you are taking payments.
<a href="https://checkout.dodopayments.com/buy/pdt_YOUR_ID?quantity=1&redirect_url=https%3A%2F%2Fyoursite.com%2Fthanks">
Buy now · $29
</a>
On this site I keep every product's link in one small data file and check that it really is an https Dodo address before a button uses it. If a product has no link yet, the button sends the visitor to the contact form instead of showing a fake checkout. That one check stops a typo from sending a customer to the wrong place.
Level 2: overlay checkout (buyer never leaves your page)
Install dodopayments-checkout, call Initialize once with mode: "test" while building (switch to "live" later), then open the overlay with a checkout session URL from your server. The SDK emits events such as checkout.opened, checkout.error and checkout.closed, which are useful for analytics and for showing a friendly message if something fails.
import { DodoPayments } from "dodopayments-checkout";
DodoPayments.Initialize({
mode: "test", // change to "live" for production
displayType: "overlay",
onEvent: (event) => console.log(event.event_type),
});
// checkoutUrl comes from YOUR server (see Level 3), never hard-coded
DodoPayments.Checkout.open({ checkoutUrl });
Level 3: checkout sessions from your server
This is what I recommend once you have accounts on your site. Your server calls POST /checkouts with a product_cart, the customer's email, a return_url and your own metadata, such as the signed-in user's ID. You get back a checkout_url that works once and expires after 24 hours. Because you created it, you know exactly who is buying, so the webhook can unlock the right account without guessing from an email address.
// Cloudflare Worker: create a checkout for the signed-in user
const res = await fetch(env.DODO_API_BASE + "/checkouts", {
method: "POST",
headers: {
Authorization: "Bearer " + env.DODO_PAYMENTS_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
product_cart: [{ product_id: "pdt_YOUR_ID", quantity: 1 }],
customer: { email: user.email, name: user.name },
return_url: "https://yoursite.com/account?paid=1",
metadata: { user_id: user.id },
}),
});
const { checkout_url } = await res.json();
Keep the API key in a Worker secret, never in front-end code. If you can see the key in your browser's developer tools, so can everyone else.
Verifying Dodo webhooks inside a Cloudflare Worker
Dodo follows the open Standard Webhooks specification. Every call carries three headers: webhook-id, webhook-timestamp and webhook-signature. The signature is an HMAC-SHA256 of id.timestamp.body, made with your endpoint's signing secret. The official route is the standardwebhooks package. If you prefer zero dependencies on Workers, the Web Crypto version is short:
async function verifyDodo(secret, headers, rawBody) {
const id = headers.get("webhook-id");
const ts = headers.get("webhook-timestamp");
const sigs = headers.get("webhook-signature") || "";
if (!id || !ts) return false;
// reject anything older or newer than 5 minutes (replay protection)
if (Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
const keyBytes = Uint8Array.from(atob(secret.replace(/^whsec_/, "")), (c) => c.charCodeAt(0));
const key = await crypto.subtle.importKey("raw", keyBytes, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
const mac = await crypto.subtle.sign("HMAC", key, new TextEncoder().encode(id + "." + ts + "." + rawBody));
const expected = btoa(String.fromCharCode(...new Uint8Array(mac)));
// header may hold several "v1,<base64>" values separated by spaces
return sigs.split(" ").some((s) => s.split(",")[1] === expected);
}
Three details trip people up. Read the body with await request.text() and verify that exact string; parsing JSON first and re-stringifying it changes the bytes and breaks the signature. Return HTTP 400 when verification fails, as Dodo's guide asks. And for production code, swap the plain === for a constant-time comparison so response timing reveals nothing.
Then act on the event. payment.succeeded is the one that grants access. payment.failed, payment.processing and payment.cancelled should never unlock anything. Refund and subscription events are listed in Dodo's webhook event guide; subscribe to the refund ones so a refunded purchase locks the file again.
Integrating Paddle on a live site
Paddle Billing (the current version, often called "Paddle v2") follows the same shape with different names.
Paddle.js checkout
Load Paddle.js, set the sandbox environment while you test, initialise it with your client-side token, and open a checkout with one or more priceId items. You can pre-fill the customer's email, attach your own customData (I put the signed-in user's ID there), and choose overlay or inline display.
Paddle.Environment.set("sandbox"); // remove for live
Paddle.Initialize({ token: "test_..." }); // client-side token only
Paddle.Checkout.open({
items: [{ priceId: "pri_YOUR_PRICE", quantity: 1 }],
customer: { email: user.email },
customData: { user_id: user.id },
settings: { displayMode: "overlay", successUrl: "https://yoursite.com/account?paid=1" },
});
The client-side token is designed to be public. Your API key is not. If a tutorial ever tells you to put the API key in the browser, close the tab.
Verifying Paddle webhooks
Paddle signs every notification with a Paddle-Signature header that looks like ts=1671552777;h1=eb4d.... To check it, join the ts value, a colon and the untouched raw body, then compute an HMAC-SHA256 with your notification destination's secret. During secret rotation more than one h1 can appear, so accept a match on any of them. Paddle's SDKs reject messages whose timestamp is more than five seconds off by default; if you write your own check, keep the window tight.
async function verifyPaddle(secret, header, rawBody) {
const parts = Object.fromEntries((header || "").split(";").map((p) => p.split("=")));
const ts = Number(parts.ts);
if (!ts || Math.abs(Date.now() / 1000 - ts) > 5) return false;
const key = await crypto.subtle.importKey("raw", new TextEncoder().encode(secret), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
const mac = await crypto.subtle.sign("HMAC", key, new TextEncoder().encode(ts + ":" + rawBody));
const hex = [...new Uint8Array(mac)].map((b) => b.toString(16).padStart(2, "0")).join("");
return header.split(";").some((p) => p === "h1=" + hex);
}
The events you care about for digital downloads are transaction.completed to grant access, and the adjustment events for approved refunds to take it away.
Webhook handling: the same five rules for both
| Rule | Why it matters | How I do it |
|---|---|---|
| Verify before you parse | Stops fake "payment succeeded" calls | Check the signature on the raw text body first |
| Reject stale timestamps | Stops an attacker replaying an old, valid message | Small time window; Paddle defaults to 5 seconds, Standard Webhooks commonly 5 minutes |
| Process each event once | Providers retry; you must not grant twice or email twice | Save the event ID in a table with a unique key; skip if it already exists |
| Answer fast | Slow replies cause retries and duplicates | Record and grant, return 200, then send emails in the background |
| Let failures retry | A database hiccup should not lose a paid order | If your own processing fails, delete the saved event ID and return 500 so the provider tries again |
On a Cloudflare Worker with a D1 database, the "process once" rule is a single statement: INSERT OR IGNORE INTO webhook_events (event_id, received_at) VALUES (?, ?). If it changed no rows, you have seen this event before and you return 200 without doing anything else.
Matching a payment to the right customer
This is where most small sites leak paid products. If your webhook unlocks the file for whatever email address appears in the payment, someone can buy with their own card while typing your other customer's email, or the reverse. My order of trust is simple:
- Best: the user ID you put in
metadata(Dodo) orcustomData(Paddle) when the signed-in buyer started checkout. - Acceptable: the buyer's email, but only unlock it on an account whose email address has been verified.
- Otherwise: store the purchase as "pending" against that email. It becomes real access the moment someone verifies that address.
Launch checklist
| Check | Done when |
|---|---|
| Test mode end to end | A test purchase unlocks the file, and a test refund locks it again |
| Live keys only on the server | No API key or webhook secret appears anywhere in the browser or in your Git history |
| Webhook endpoint is HTTPS and verified | A request with a wrong signature gets 400 or 401, and nothing changes |
| Duplicates are harmless | Sending the same event twice grants access once |
| Legal pages name your Merchant of Record | Privacy, refund and terms pages say who processes payments and link to their buyer terms |
| Every Buy button goes somewhere real | No placeholder price, no "$0", no alert box pretending to be a checkout |
That last row is not a joke. While auditing this very site I found a checkout box that showed "$0" and a placeholder message instead of opening a real payment. It looked finished. It was not. Click every button yourself before you spend money on ads.
So which one should you choose?
If you are a solo builder selling low-priced digital products and you want the simplest path, Dodo Payments' payment links get you live in an afternoon, and the lower fixed fee is kinder to a $19 or $29 product. That is why this site uses Dodo today. If you run a larger SaaS with complex subscription logic and want the more established platform, Paddle is a proven choice with excellent tooling.
Whichever you pick, the hard part is not the button. It is the webhook: verify it, process it once, tie it to the right account, and handle refunds. Get those four right and either provider will serve you well.
About this article: written by Deepak Kumar with AI assistance for drafting and research. Technical details were checked against Paddle's and Dodo Payments' official developer documentation and published pricing in November 2026. Payment providers change their APIs and fees, so confirm current details in their docs before you go live. Need it wired into your own site? Get in touch.
Written by Deepak Kumar
Regulatory Affairs specialist and software engineer building intelligent compliance systems and high-precision digital tools.