codeplugtech/dodo-payments

Laravel Package for Dodo Payments

0.0.4 2025-06-24 08:14 UTC

This package is auto-updated.

Last update: 2025-06-24 08:24:27 UTC


README

  1. add the Billable trait to your billable model definition.
use Laravel\Cashier\Billable;
 
class User extends Authenticatable
{
    use Billable;
}
  1. API Keys
DODO_PAYMENT=YOUR_API_KEY
DODO_SANDBOX=true
DODO_WEBHOOK_SECRET=YOUR_WEBHOOK_KEY
  1. You can create check using below code
 $user->newSubscription('default', 'prod_id')
            ->setBilling($billing)
            ->setReturnUrl(route('user.dashboard'))
            ->create();
  1. Exclude dodo/* from CSRF protection bootstrap/app.php file for Laravel 11
->withMiddleware(function (Middleware $middleware) {
    $middleware->validateCsrfTokens(except: [
        'dodo/*',
    ]);
})