A Laravel billing package for payments and subscriptions with FedaPay integration. Supports Mobile Money (MTN, Moov, Togocel), one-time payments, recurring subscriptions, and marketplace features with commissions and payouts for West African markets.
# Laravel Billing
A powerful Laravel billing package for payments and subscriptions, inspired by Laravel Cashier. Built specifically for West African markets with **FedaPay** integration, supporting Mobile Money (MTN, Moov, Togocel), one-time payments, recurring subscriptions, and marketplace features with commissions and payouts.
## Features
- **Multiple Payment Providers** - Extensible architecture with FedaPay as the default provider
- **Mobile Money Support** - MTN Mobile Money, Moov Money, Togocel T-Money with USSD Push
- **Subscriptions** - Full subscription lifecycle management with trials, grace periods, and plan swapping
- **One-time Payments** - Simple charge API for single payments
- **Marketplace Module** - Commission calculation, transaction tracking, and seller payouts
- **Webhook Handling** - Automatic webhook processing with signature verification
- **Multi-currency** - Support for XOF and other currencies
- **Localization** - French and English translations included
## Requirements
- PHP 8.4+
- Laravel 11.x or 12.x
## Installation
Install the package via Composer:
```bash
composer require ratoufa/laravel-billing
```
Run the install command to publish configuration and migrations:
```bash
php artisan billing:install
```
Or publish manually:
```bash
# Publish configuration
php artisan vendor:publish --tag="billing-config"
# Publish migrations
php artisan vendor:publish --tag="billing-migrations"
# Publish translations (optional)
php artisan vendor:publish --tag="billing-translations"
```
Run the migrations:
```bash
php artisan migrate
```
## Configuration
Add your FedaPay credentials to your `.env` file:
```env
BILLING_PROVIDER=fedapay
FEDAPAY_PUBLIC_KEY=pk_sandbox_xxxxxxxx
FEDAPAY_SECRET_KEY=sk_sandbox_xxxxxxxx
FEDAPAY_ENV=sandbox
FEDAPAY_CURRENCY=XOF
FEDAPAY_WEBHOOK_SECRET=whsec_xxxxxxxx
```
### Full Configuration Options
```php
// config/billing.php
return [
// Default billing provider
'default' => env('BILLING_PROVIDER' …