New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

telegram-bot-essentials/billing

Invoices, payments and a pluggable gateway registry for telegram-bot-essentials/essence
1,348
Install
composer require telegram-bot-essentials/billing
Latest Version:v0.0.54
PHP:^8.3
Laravel:12 · 13
License:MIT
Last Updated:Nov 11, 2026
Links: GitHub  ·  Packagist
Maintainer: Elyar0

Telegram Bot Essentials — Billing

Latest Version tests License: MIT

Invoices, payment attempts, a pluggable gateway registry, and currency conversion on top of telegram-bot-essentials/essence.

Billing does not talk to any payment provider itself — that's what gateway-card and gateway-zibal are for. It defines the contract they implement, plus the invoice lifecycle and admin UI everything else plugs into.

Depends on telegram-bot-essentials/settings.

Installation

composer require telegram-bot-essentials/billing
php artisan migrate

# optional — customize supported currencies
php artisan vendor:publish --tag=tbe-billing-config

Usage

Make your sellable thing an Order:

use TelegramBotEssentials\Billing\Models\Abstract\Order;

class SubscriptionOrder extends Order
{
    public function getPaidAtAttribute(): ?Carbon { /* ... */ }
    public function getAmountAttribute(): string { /* ... */ }
    public function getDescriptionAttribute(): string { /* ... */ }

    public function invoicePaidHook(): void { /* fulfil the order */ }
    public function cancelOrderHook(): void { /* invoice was revoked — undo it */ }
}

Create and drive an invoice:

$invoice = billing()->createInvoice($order);
$invoice->markAsPaid();   // fires InvoicePaid → your invoicePaidHook() runs automatically

Status transitions always go through markAsPaid() / markAsFailed() / markAsPending(), never a raw update(), so each one fires its event and runs in the correct webhook context even when triggered from a gateway's server-to-server callback.

Gateway packages register themselves into gateways(); the member-facing InvoiceFeature renders a "choose a payment method" screen from whatever is registered. When user-management is installed, Billing adds a per-payable-type revenue breakdown to the user-list header.

MarkOverdueInvoicesAsFailed runs hourly — make sure Laravel's scheduler (schedule:run via cron, or schedule:work) is running in production.

Documentation

Full documentation — the Order / HasInvoice / PaymentAttempt contracts, the gateway registry, currency conversion, and the revenue stats block — lives on the Telegram Bot Essentials documentation site under Modules → Billing.

License

MIT.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

655,942,320 9,702
laravel/framework

The Laravel Framework.

617,629,957 34,997
laravel/tinker

Powerful REPL for the Laravel framework.

524,145,802 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

442,489,569 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

418,503,470 4,663

Version History

Version Released PHP Laravel License
v0.0.54 ^8.3 ^12 || ^13 MIT
v0.0.53 ^8.3 ^12 || ^13 MIT
v0.0.52 ^8.3 ^12 || ^13 MIT
v0.0.51 ^8.3 ^12 || ^13 MIT
v0.0.50 ^8.3 ^12 || ^13 MIT