Alpha release -- under active development. Expect breaking changes.
Framework-agnostic fluent PHP SDK for Vatly billing. Wraps the vatly-api-php client with expressive, action-based methods for managing subscriptions, checkouts, customers, and webhooks.
This package serves as the core logic layer, designed to be portable across PHP frameworks and as a reference for future language ports (JS, Python).
composer require vatly/vatly-fluent-phpThis package follows semantic versioning. During alpha, pin to exact versions if you need stability:
composer require vatly/vatly-fluent-php:v0.3.0-alpha.2- PHP 8.2+
- A Vatly API key (vatly.com)
- Actions: CreateCheckout, CreateCustomer, GetCheckout, GetCustomer, GetSubscription, GetPaymentMethodUpdateUrl, CancelSubscription, SwapSubscriptionPlan
- Webhook handling: Signature verification, event factory, typed event objects
- Contracts: BillableInterface, repository interfaces for framework integration
- Responses: Typed response objects for all actions
use Vatly\API\VatlyApiClient;
use Vatly\Fluent\Actions\CreateCheckout;
$client = new VatlyApiClient();
$client->setApiKey('test_xxxxxxxxxxxx');
$checkout = new CreateCheckout($client);
$response = $checkout->execute([
'products' => ['subscription_plan_id'],
'customerId' => 'cust_xxx',
'redirectUrlSuccess' => 'https://example.com/success',
'redirectUrlCanceled' => 'https://example.com/canceled',
]);If you're using Laravel, see vatly/vatly-laravel which provides Eloquent models, traits, builders, and event listeners on top of this package.
composer testMIT