vatly / vatly-fluent-php
Framework-agnostic fluent PHP SDK for Vatly billing
Requires
- php: ^8.0
- vatly/vatly-api-php: ^0.1.0-alpha.5
Requires (Dev)
- mockery/mockery: ^1.6
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.6
- dev-main
- v0.6.0-alpha.1
- v0.5.0-alpha.1
- v0.4.0-alpha.3
- v0.4.0-alpha.2
- v0.4.0-alpha.1
- v0.3.0-alpha.2
- v0.3.0-alpha.1
- v0.2.0-alpha.2
- v0.2.0-alpha.1
- v0.1.0-alpha.2
- v0.1.0-alpha.1
- dev-feat/dev-xp-log-3
- dev-chore/sync-openapi-self-service-link-renames
- dev-chore/laravel-only-messaging
- dev-feat/billable-orchestrator
- dev-chore/reposition-as-driver-internals
- dev-chore/rename-create-billing-update-link
- dev-chore/untrack-phpunit-cache
- dev-chore/php80-and-openapi-sync
- dev-chore/php80-compat
- dev-larafast_dev_sprint
- dev-feature/webhook-processor
This package is auto-updated.
Last update: 2026-05-21 21:40:24 UTC
README
Alpha release -- under active development. Expect breaking changes.
The framework-agnostic core that powers vatly/vatly-laravel — webhook processing, contracts, events, DTOs, and the per-owner orchestrator (Vatly\Fluent\Billable) that the Laravel package reuses so it doesn't reimplement them inline.
Looking for a Vatly integration?
Most users want vatly-laravel, not this package directly:
| Use case | Package |
|---|---|
| Laravel application | vatly/vatly-laravel |
| Raw API access (no framework) | vatly/vatly-api-php |
This package on its own doesn't persist anything, dispatch events, or read configuration — those concerns belong to the Laravel package. You install it transitively when you require vatly/vatly-laravel.
Installation
Requires PHP 8.0+ and a Vatly API key (vatly.com).
composer require vatly/vatly-fluent-php
Pin to an exact version during alpha:
composer require vatly/vatly-fluent-php:v0.5.0-alpha.1
What's inside
- Orchestrator (src/Billable.php, src/BillableFactory.php, src/SubscriptionHandle.php): the canonical per-owner API surface —
subscribe(),checkout(),subscribed(),subscription(),createAsVatlyCustomer(), etc. - Contracts (src/Contracts):
BillableInterface,SubscriptionInterface,OrderInterface, repository interfaces (subscription / customer / order / webhook call),EventDispatcherInterface,ConfigurationInterface,WebhookReactionInterface. - Webhook pipeline (src/Webhooks):
WebhookProcessororchestrates signature verification → event parsing → audit logging → reactions → dispatch. Built-in reactions:SyncSubscriptionOnStarted,StoreOrderOnPaid,CancelSubscriptionOnCanceled. Wire it in one call withWebhookProcessorFactory::create(). - Events (src/Events): typed POPOs —
OrderPaid,SubscriptionStarted,SubscriptionCanceledImmediately,SubscriptionCanceledWithGracePeriod,LocalSubscriptionCreated,WebhookReceived,UnsupportedWebhookReceived. - Actions (src/Actions): thin wrappers around
vatly/vatly-api-phpreturning rawVatly\API\Resources\*objects. - Builders (src/Builders):
CheckoutBuilderandSubscriptionBuilderdriven by aBillableInterface. - Data DTOs (src/Data): immutable inputs for repository operations.
Testing
composer test
Contributing
See CONTRIBUTING.md for local setup, design principles, and the PR process.
License
MIT