codeplugtech/dodo-payments

Laravel Package for Dodo Payments

0.0.3 2025-02-21 12:41 UTC

This package is auto-updated.

Last update: 2025-05-21 13:13:12 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/*',
    ]);
})