Paddle Billing
Quickstart
Install, configure, and make your first Paddle API call with Vortos.
Quickstart
Register the package
use Vortos\Paddle\DependencyInjection\PaddlePackage;
$packages = [
new PaddlePackage(),
];Run migrations
php bin/console vortos:migrate:runThis creates the outbox, idempotency, webhook idempotency, audit log, transactions, and subscriptions tables.
Create the config file
<?php
declare(strict_types=1);
use Vortos\Paddle\DependencyInjection\VortosPaddleConfig;
return static function (VortosPaddleConfig $config): void {
$config
->mode($_ENV['PADDLE_MODE'] ?? 'sandbox')
->apiKey($_ENV['PADDLE_API_KEY'] ?? '')
->notificationSecret($_ENV['PADDLE_NOTIFICATION_SECRET'] ?? '')
->webhookPath('/webhooks/paddle');
};Set environment variables
PADDLE_MODE=sandbox
PADDLE_API_KEY=your_sandbox_api_key
PADDLE_NOTIFICATION_SECRET=your_webhook_secretMake your first API call
use Vortos\Paddle\Customer\Contract\StandaloneCustomerServiceInterface;
use Vortos\Paddle\Customer\Operation\CreateCustomerRequest;
final class RegisterUserHandler
{
public function __construct(
private readonly UserRepository $users,
private readonly StandaloneCustomerServiceInterface $customers,
) {}
public function handle(RegisterUser $command): void
{
$user = User::register($command->email);
$this->users->save($user);
$paddleId = $this->customers->create(new CreateCustomerRequest(
email: $command->email,
name: $command->name,
));
$user->assignPaddleCustomerId($paddleId);
$this->users->save($user);
}
}Sandbox IPs are auto-allowed
When PADDLE_MODE=sandbox, the webhook controller automatically allows Paddle sandbox IPs. You do not need to call allowSandboxIps(true) manually.