laravel-paystack maintained by edydeyemi
Description
A modern, fluent PHP/Laravel 13 package for integrating Paystack payments, subscriptions, transfers, subaccounts, dedicated virtual accounts, and webhooks.
Author
edydeyemi
Last update
2026/11/25 02:32
(dev-dev)
License
Downloads
1
Laravel Paystack (edydeyemi/laravel-paystack)
A modern, fluent PHP 8.3+ / Laravel 13 package for integrating Paystack payments, refunds, customers, plans, subscriptions, transfers, subaccounts, splits, dedicated virtual accounts (DVA), verification, and webhooks.
Features
- Fluent Resource API:
Paystack::transactions(),customers(),plans(),subscriptions(),transfers(),transferRecipients(),subaccounts(),splits(),dedicatedAccounts(),refunds(),verification(), andmiscellaneous(). - Laravel HTTP Client Native: Built on
Illuminate\Http\Client\Factory, soHttp::fake()works seamlessly in tests. - Immutable Response Wrapper:
PaystackResponsewithok(),status(),message(), dot-notateddata()andmeta(),ArrayAccess, andJsonSerializable. - Verified Webhooks & Typed Events: Auto-registered webhook route with HMAC-SHA512 signature verification, optional IP allowlist,
PaystackWebhookReceived, and 13 typed Paystack events. - Explicit Amount Helpers:
Amount::toMinor(),Amount::toMajor(), andAmount::format()to prevent unit-conversion bugs. - Strict Typing: PHPStan/Larastan Level 8 clean, Laravel Pint formatted, and Pest tested.
Quick Start
composer require edydeyemi/laravel-paystack
php artisan vendor:publish --tag="paystack-config"
Add your keys to .env:
PAYSTACK_SECRET_KEY=sk_test_...
PAYSTACK_PUBLIC_KEY=pk_test_...
PAYSTACK_CURRENCY=NGN
Initialize a payment:
use Edydeyemi\Paystack\Facades\Paystack;
use Edydeyemi\Paystack\Support\Amount;
$response = Paystack::transactions()->initialize([
'email' => 'customer@example.com',
'amount' => Amount::toMinor(5000), // 500000 kobo
'reference' => Paystack::generateReference('ord_'),
'callback_url' => route('payment.callback'),
]);
return redirect()->away((string) $response->data('authorization_url'));
Documentation
Detailed guides and realistic Laravel 13 examples for every feature:
- Installation, Configuration & Core Concepts
- Transactions & Refunds
- Customers, Plans & Subscriptions
- Transfers & Transfer Recipients
- Subaccounts & Transaction Splits
- Dedicated Virtual Accounts (DVA), Verification & Miscellaneous
- Webhooks & Laravel Events
Testing & Quality
composer test
composer analyse
composer format