Skip to content

vatly/vatly-fluent-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vatly Fluent PHP

Latest Version on Packagist Tests Total Downloads

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).

Installation

composer require vatly/vatly-fluent-php

This 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

Requirements

What's included

  • 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

Usage

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',
]);

For framework integrations

If you're using Laravel, see vatly/vatly-laravel which provides Eloquent models, traits, builders, and event listeners on top of this package.

Testing

composer test

License

MIT

About

Framework-agnostic, fluent and expressive PHP SDK for Vatly billing

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages