Skip to main content
The PHP SDK provides a robust and flexible way to integrate Dodo Payments into your PHP applications. Built following modern PHP standards with PSR-4 autoloading, it offers extensive test coverage and detailed documentation.

Installation

Install the SDK using Composer:
The SDK requires PHP 8.0 or higher and Composer for dependency management.

Quick Start

Initialize the client and create a checkout session:
Store your API keys securely using environment variables. Never expose them in your codebase or commit them to version control.

Core Features

PSR-4 Compliant

Follows PHP Standards Recommendations for modern PHP development

Modern PHP

Built for PHP 8+ with type declarations and strict types

Extensive Testing

Comprehensive test coverage for reliability and stability

Exception Handling

Clear exception types for different error scenarios

Configuration

Retry Configuration

Configure automatic retry behavior:

Common Operations

Create a Checkout Session

Generate a checkout session:

Manage Customers

Create and retrieve customer information:

Handle Subscriptions

Create and manage recurring subscriptions:

Pagination

Work with paginated list responses:

Error Handling

Handle various API exceptions:
Always wrap API calls in try-catch blocks to handle potential errors gracefully and provide meaningful feedback to users.

Advanced Usage

Undocumented Endpoints

Make requests to undocumented endpoints:

Undocumented Parameters

Send undocumented parameters:

Framework Integration

Laravel

Create a service for Laravel applications:
Add configuration in config/services.php:

Symfony

Create a service in Symfony:
Register in config/services.yaml:

Resources

GitHub Repository

View source code and contribute

API Reference

Complete API documentation

Discord Community

Get help and connect with developers

Report Issues

Report bugs or request features

Support

Need help with the PHP SDK?

Contributing

We welcome contributions! Check the contributing guidelines to get started.