Search by

fomvasss / laravel-billing

fomvasss

Universal billing/payments package for Laravel: pluggable payment gateways, subscriptions, webhooks, usage-based pricing

Package info

github.com/fomvasss/laravel-billing

pkg:composer/fomvasss/laravel-billing

Statistics

Installs: 319

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.12.11 2026-10-07 16:31 UTC

README

License Latest Stable Version Total Downloads

Billing and payments for Laravel: pluggable payment gateways, one-off payments, saved cards, subscriptions with trials and dunning, usage-based pricing, refunds, invoices and receipts — with a webhook pipeline that is the only thing allowed to change a payment's status. Built-in gateways: Monobank Acquiring, LiqPay, WayForPay, Hutko, Stripe, Paddle, plus a fake gateway for local development.

Українською

  • One payment model for every gateway — payment_url is always a plain link; a permanent pay link re-issues expired checkouts
  • Saved cards — tokenized as a side effect of the first charge, then charged off-session
  • Subscriptions — flat, per-seat and metered prices, minute-to-year intervals, trials, pause, plan swaps, quotas, a retry ladder with grace access; renewed by the package or by the provider (Stripe Billing, Paddle)
  • Refunds — through the API, plus refunds made in a gateway's dashboard, recorded from webhooks
  • Invoices and receipts — numbered PDF documents, snapshots at issue time
  • Webhook guarantees — fail-closed signatures, amount verification, per-outcome dedup, reconciliation of lost webhooks
  • Multi-tenant — per-tenant credentials and several accounts of one gateway
  • No dependencies beyond illuminate/*, Octane-safe, MySQL/MariaDB, PostgreSQL, SQLite

Requirements

  • PHP ^8.3
  • Laravel ^12 | ^13

Installation

composer require fomvasss/laravel-billing

php artisan vendor:publish --tag=billing-migrations-core
php artisan vendor:publish --tag=billing-migrations-subscriptions    # Plan / Price / Subscription
php artisan vendor:publish --tag=billing-migrations-payment-methods  # saved cards
php artisan vendor:publish --tag=billing-migrations-invoices         # invoices and receipts
php artisan migrate
BILLING_RETURN_URL_SUCCESS=https://example.com/checkout/success
BILLING_RETURN_URL_FAILED=https://example.com/checkout/failed
BILLING_SCHEDULE_ENABLED=true

MONOBANK_TOKEN=...

Quick start

use Fomvasss\Billing\DTO\ChargeOptions;
use Fomvasss\Billing\Facades\Billing;
use Fomvasss\Billing\Models\Payment;

$payment = Payment::create([
    'gateway' => 'monobank',
    'amount' => 129900, // minor units — 1 299.00
    'currency' => 'UAH',
    'payable_type' => $order->getMorphClass(),
    'payable_id' => $order->id,
    'billable_type' => $user->getMorphClass(),
    'billable_id' => $user->id,
]);

Billing::charge($payment, new ChargeOptions(description: "Order #{$order->number}"));

return redirect($payment->payment_url);
use Fomvasss\Billing\Events\PaymentSucceeded;

Event::listen(function (PaymentSucceeded $event) {
    $event->payment->payable->markAsPaid();
});

Documentation

Online: https://fomvasss.github.io/laravel-billing/ — the same pages as in docs/.

License

MIT — see LICENSE.