telegram-bot-essentials / billing
Invoices, payments and a pluggable gateway registry for telegram-bot-essentials/essence
Package info
github.com/Telegram-Bot-Essentials/billing
pkg:composer/telegram-bot-essentials/billing
Requires
- php: ^8.3
- brick/math: >=0.14.2 <1.0
- laravel/framework: ^12 || ^13
- telegram-bot-essentials/essence: ^0.13
- telegram-bot-essentials/settings: ~0.0.17
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.18
- orchestra/testbench: ^10.0 || ^11.0
- pestphp/pest: ^3.7 || ^4.0
- pestphp/pest-plugin-laravel: ^3.1 || ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v0.0.35
- v0.0.34
- v0.0.33
- v0.0.32
- v0.0.31
- v0.0.30
- v0.0.29
- v0.0.28
- v0.0.27
- v0.0.26
- v0.0.25
- v0.0.24
- v0.0.23
- v0.0.22
- v0.0.21
- v0.0.20
- v0.0.19
- v0.0.18
- v0.0.17
- v0.0.16
- v0.0.15
- v0.0.14
- v0.0.13
- v0.0.12
- v0.0.11
- v0.0.10
- v0.0.9
- v0.0.8
- v0.0.7
- v0.0.6
- v0.0.5
- v0.0.4
- v0.0.3
- 0.0.2
- 0.0.1
- dev-chore/release-0.0.35
- dev-chore/ci-fixes
- dev-feat/offer-codes
This package is auto-updated.
Last update: 2026-09-20 16:47:29 UTC
README
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.