One-time and subscription
Hosted Dodo checkout for a single purchase and a monthly plan. Product ids come from config, never from the browser.
LaraPaid is a working Laravel app with Dodo Payments already wired in: checkout, signed webhooks, subscriptions, refunds and passwordless login. Extracted from a live SaaS, covered by 112 tests.
Stripe onboards businesses from a few dozen countries. If yours is not on the list, the popular starter kits leave you with a billing layer you cannot switch on.
Dodo Payments is a Merchant of Record: it sells on your behalf, handles VAT and sales tax, and pays you out. It onboards founders from countries Stripe does not serve, mine included. What it does not have is a Laravel kit that covers the whole payment lifecycle.
That lifecycle is where the time goes. A checkout button takes an afternoon. Cancellations, refunds, late webhooks and people who pay with a different email take weeks, and you find them one support ticket at a time.
Not a skeleton with TODOs. Clone it, add your Dodo keys, and a visitor can pay you in test mode fifteen minutes later.
Hosted Dodo checkout for a single purchase and a monthly plan. Product ids come from config, never from the browser.
Signature checked over the raw body. Each event is applied exactly once, inside one transaction, and survives redelivery.
Renewal, cancel now, cancel at period end, resume, on hold, expired, refunded. Access always matches what was paid for.
One email with a link and a 6-digit code. Single use, five attempts, rate limited per address and per IP.
Visitors buy without signing up. The payment creates the account and logs in only the browser that paid.
"Manage subscription" opens Dodo's portal for invoices, payment method and cancellation.
A free watermarked preview, then pay to download. Rendered by Gotenberg on a queue. Replace it with your own product.
Pricing, Terms, Privacy, Refund and Contact pages, filled from your .env. Dodo asks for them before approving a site.
GitHub Actions with an SSH key that can only run the deploy. Nginx, PHP-FPM, systemd, cron and backup templates.
Each one below is handled in the kit and pinned down by a test. The names under them are real test methods.
The webhook-id is claimed by a unique insert in the same transaction as the changes. A duplicate answers 200 and does nothing.
The transaction rolls back together with the claimed id, the endpoint answers 500, and the retry runs from a clean state.
test_failed_processing_releases_webhook_id_so_retry_succeedsThe return page asks the Dodo API, shows "finishing up", and moves on the moment the webhook lands. Access is never granted from the URL.
test_webhook_delay_shows_finishing_up_then_redirects_once_it_arrivesNobody verifies the email typed at checkout. An existing account is never opened by a payment; its owner gets a login email instead.
test_guest_paying_with_an_existing_accounts_email_is_not_logged_inThe account id travels in signed checkout metadata, so the purchase lands on the account that started it.
test_logged_in_a_paying_with_email_b_gives_pro_to_aDodo reports it as cancelled at once, with the paid date still in the future. Pro stays until that date and the grace days are dropped.
test_portal_cancel_payload_keeps_pro_until_next_billing_dateA scheduled cancellation is undone with one API call. An ended one restarts with a trial that lasts exactly until the paid date, so nobody pays twice for the same days.
test_turn_renewal_back_on_after_immediate_cancel_starts_a_trial_until_the_paid_period_endsPro is revoked immediately, and a late cancellation event cannot bring it back. A refund of a one-time purchase leaves Pro alone.
test_refund_of_a_subscription_payment_revokes_pro_immediatelyPro runs until the later paid date. Nothing is cancelled automatically; support gets an alert email.
test_second_active_subscription_alerts_support_and_cancels_nothingEmails are sent after the commit. A mail failure is logged, the webhook still answers 200 and access is granted.
test_mail_failure_after_commit_still_returns_200_and_grants_proOne class talks to the Dodo SDK. One class turns events into database changes. Comments explain why, not what.
dodopayments/client SDKAGENTS.md so Claude Code and Cursor follow the payment rulespublic function handle(string $webhookId, array $event): bool
{
$after = [];
$fresh = DB::transaction(function () use (...) {
// Claim the id and apply the event atomically.
$claimed = DB::table('webhook_events')
->insertOrIgnore(['webhook_id' => $webhookId, ...]);
if (! $claimed) {
return false; // a duplicate
}
match (true) {
$type === 'payment.succeeded'
=> $this->paymentSucceeded($data, $after),
$type === 'subscription.updated'
=> $this->subscriptionUpdated($data, $after),
$type === 'refund.succeeded'
=> $this->refundSucceeded($data),
// ...renewals, cancellations, on hold
default => null, // acknowledged, ignored
};
return true;
});
// Emails and queue jobs run only after the commit.
foreach ($fresh ? $after : [] as $callback) { ... }
return $fresh;
}
It is a focused kit. Better to know before you pay.
Pay once, get the repository, keep it. There is no subscription and no per-project fee.
Payment is handled by Dodo Payments, the Merchant of Record. Taxes are calculated at checkout for your country, and you get a proper invoice.
Repository access is delivered automatically after payment.
Right after payment you get an email from Dodo Payments with a link to your customer portal. There you connect your GitHub account, and an invitation to the private repository arrives on GitHub. Accept it and clone. If anything goes wrong, write to [email protected] and you will be added by hand.
Dodo publishes the list of countries it onboards merchants from in its documentation ("Countries Eligible for Merchant Acceptance"). Check it for your country before buying: the kit is only useful if you can open a Dodo account.
Yes. One license covers one developer and any number of end products, yours or your clients'. You may not resell or publish the kit itself. The full text is in the license.
No. It exists so that checkout, webhooks and the queue have something real to do. The guide "Make it yours" lists the files to change for a "pay per item" product and for a "subscription unlocks the app" product.
The payment, webhook and login code is plain Laravel and does not care about your frontend. The included views are Blade with no build step. You can add Livewire or Inertia on top; the kit does not ship them.
Write within 14 days of the purchase and you get your money back. Access to the repository is removed and the license ends. Details are on the refund page.
Fixes and improvements go to the same repository, and you keep access. No specific roadmap is promised: buy it for what it does today.
No. LaraPaid is an independent product. It uses the official Dodo Payments PHP SDK and the Laravel framework, and is not affiliated with or endorsed by either company.
Start from a kit where the hard cases are already handled and tested.