laravel 13 · dodo payments · no node

Ship a paid Laravel SaaS where Stripe isn't an option.

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.

  • One-time payment
  • Unlimited projects
  • 14-day refund
why this exists

Every Laravel boilerplate assumes you have Stripe.

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.

I build SaaS products from Kyrgyzstan, where Stripe is not available. LaraPaid is the payment and login code from one of them, cleaned up, documented and stripped of everything product-specific. — the author
what's inside

A small product that already takes money.

Not a skeleton with TODOs. Clone it, add your Dodo keys, and a visitor can pay you in test mode fifteen minutes later.

01 checkout

One-time and subscription

Hosted Dodo checkout for a single purchase and a monthly plan. Product ids come from config, never from the browser.

02 webhooks

Signed and idempotent

Signature checked over the raw body. Each event is applied exactly once, inside one transaction, and survives redelivery.

03 subscriptions

The whole lifecycle

Renewal, cancel now, cancel at period end, resume, on hold, expired, refunded. Access always matches what was paid for.

04 login

Passwordless

One email with a link and a 6-digit code. Single use, five attempts, rate limited per address and per IP.

05 guests

Pay first, account later

Visitors buy without signing up. The payment creates the account and logs in only the browser that paid.

06 portal

Customer portal

"Manage subscription" opens Dodo's portal for invoices, payment method and cancellation.

07 demo product

Text to PDF

A free watermarked preview, then pay to download. Rendered by Gotenberg on a queue. Replace it with your own product.

08 legal pages

Ready for review

Pricing, Terms, Privacy, Refund and Contact pages, filled from your .env. Dodo asks for them before approving a site.

09 deploy

Push to main

GitHub Actions with an SSH key that can only run the deploy. Nginx, PHP-FPM, systemd, cron and backup templates.

edge cases

The cases you would otherwise meet in production.

Each one below is handled in the kit and pinned down by a test. The names under them are real test methods.

  • Dodo delivers the same webhook twice

    The webhook-id is claimed by a unique insert in the same transaction as the changes. A duplicate answers 200 and does nothing.

    test_duplicate_webhook_id_is_processed_once
  • Your handler crashes halfway through

    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_succeeds
  • The buyer returns before the webhook arrives

    The 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_arrives
  • A guest pays with someone else's email

    Nobody 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_in
  • A logged-in user pays with a different email

    The 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_a
  • The subscription is cancelled in the portal

    Dodo 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_date
  • They change their mind and want Pro back

    A 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_ends
  • A subscription payment is refunded

    Pro 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_immediately
  • One account ends up with two subscriptions

    Pro runs until the later paid date. Nothing is cancelled automatically; support gets an alert email.

    test_second_active_subscription_alerts_support_and_cancels_nothing
  • Mail is down when the payment arrives

    Emails 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_pro
the code

Readable enough to change with confidence.

One class talks to the Dodo SDK. One class turns events into database changes. Comments explain why, not what.

  • Laravel 13, PHP 8.3+, the official dodopayments/client SDK
  • Blade and plain CSS. No Node, no build step
  • SQLite locally, PostgreSQL and Redis in production
  • An AGENTS.md so Claude Code and Cursor follow the payment rules
app/Services/Dodo/PaymentProcessor.php
public 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;
}
scope

What you get, and what you don't.

It is a focused kit. Better to know before you pay.

Included

  • The full source code in a private GitHub repository
  • Five guides: Dodo setup, how payments work, make it yours, deploy, configuration
  • 112 tests, with Dodo and Gotenberg faked so they run offline
  • Server templates for a VPS behind Cloudflare Tunnel
  • Light and dark theme driven by CSS variables
  • Updates pushed to the same repository

Not included

  • Stripe, Paddle or Lemon Squeezy drivers. It is Dodo Payments only
  • Livewire, Inertia, Vue or React. Views are Blade
  • Teams, roles and multi-tenancy
  • An admin panel
  • Usage-based billing and license keys
  • Password login and social login
pricing

One price. Build as many products as you like.

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.

LaraPaid · single developer
$99one-time, plus tax where it applies
  • Full source code, private GitHub repository
  • Unlimited personal and client projects
  • All documentation and deploy templates
  • Updates to the repository
  • 14-day refund if it is not what you need
Get LaraPaid — $99

Repository access is delivered automatically after payment.

faq

Questions before you buy.

How do I get the code?

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.

Can I use Dodo Payments in my country?

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.

Can I use it for client work or several products?

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.

Do I have to keep the PDF demo?

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.

Does it work with Livewire or Inertia?

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.

What is the refund policy?

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.

Will there be updates?

Fixes and improvements go to the same repository, and you keep access. No specific roadmap is promised: buy it for what it does today.

Is this an official Dodo Payments or Laravel product?

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.

Skip the weeks of payment plumbing.

Start from a kit where the hard cases are already handled and tested.