fomvasss / laravel-billing
Universal billing/payments package for Laravel: pluggable payment gateways, subscriptions, webhooks, usage-based pricing
0.12.11
2026-10-07 16:31 UTC
Requires
- php: ^8.3
- illuminate/contracts: ^12.0|^13.0
- illuminate/database: ^12.0|^13.0
- illuminate/events: ^12.0|^13.0
- illuminate/http: ^12.0|^13.0
- illuminate/queue: ^12.0|^13.0
- illuminate/routing: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- illuminate/view: ^12.0|^13.0
Requires (Dev)
- barryvdh/laravel-dompdf: ^3.1
- orchestra/testbench: ^10.0|^11.0
- phpunit/phpunit: ^11.0
Suggests
- barryvdh/laravel-dompdf: PDF invoices and receipts with the default InvoiceRenderer (or bind your own)
- fomvasss/laravel-currency: Currency conversion adapter for CurrencyConverterContract when a gateway doesn't support the Price's currency
Provides
None
Conflicts
None
Replaces
None
README
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_urlis 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/.
- Installation · Configuration
- Payments · Return pages and the pay link · Fiscal receipt items · Refunds · Saved cards
- Subscriptions · Trials · Renewals and dunning · Usage and quotas · Provider-managed subscriptions
- Invoices and receipts · Webhooks · Scheduled commands · Tenants and multiple accounts · Money and currencies · Testing
- Gateways: Overview · Monobank · LiqPay · WayForPay · Hutko · Stripe · Paddle · Fake
- Guides: Production checklist · Use cases · Architecture · Writing a gateway · Testing webhooks by hand
- Reference: Billing facade · Models · Database · Events · Commands · Contracts · DTOs and enums · Routes
- Upgrading · Changelog
License
MIT — see LICENSE.