codeplugtech / dodo-payments
Laravel Package for Dodo Payments
0.0.3
2025-02-21 12:41 UTC
Requires
- php: ^8.2
- ext-json: *
- ext-openssl: *
- guzzlehttp/guzzle: ^7.4.5
- illuminate/contracts: ^10.0|^11.0|^12.0
- illuminate/database: ^10.0|^11.0|^12.0
- illuminate/http: ^10.0|^11.0|^12.0
- illuminate/routing: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
- illuminate/view: ^10.0|^11.0|^12.0
- moneyphp/money: ^3.2|^4.0
- nesbot/carbon: ^2.67|^3.0
- spatie/url: ^1.3.5|^2.0
- symfony/http-kernel: ^6.2|^7.0
- symfony/polyfill-intl-icu: ^1.22.1
Requires (Dev)
- mockery/mockery: ^1.5.1
- orchestra/testbench: ^8.14|^9.0
- pestphp/pest: ^3.6
- phpstan/phpstan: ^1.10
Suggests
- ext-intl: Allows for more locales besides the default "en" when formatting money values.
README
- add the Billable trait to your billable model definition.
use Laravel\Cashier\Billable;
class User extends Authenticatable
{
use Billable;
}
- API Keys
DODO_PAYMENT=YOUR_API_KEY
DODO_SANDBOX=true
DODO_WEBHOOK_SECRET=YOUR_WEBHOOK_KEY
- You can create check using below code
$user->newSubscription('default', 'prod_id')
->setBilling($billing)
->setReturnUrl(route('user.dashboard'))
->create();
- Exclude dodo/* from CSRF protection bootstrap/app.php file for Laravel 11
->withMiddleware(function (Middleware $middleware) {
$middleware->validateCsrfTokens(except: [
'dodo/*',
]);
})