edydeyemi / laravel-paystack
A modern, fluent PHP/Laravel 13 package for integrating Paystack payments, subscriptions, transfers, subaccounts, dedicated virtual accounts, and webhooks.
v1.0.0
2026-11-25 01:07 UTC
Requires
- php: ^8.3
- brick/math: ^1.0
- illuminate/contracts: ^13.0
- illuminate/http: ^13.0
- illuminate/routing: ^13.0
- illuminate/support: ^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.20
- orchestra/testbench: ^11.0
- pestphp/pest: ^3.0 || ^4.0
- pestphp/pest-plugin-laravel: ^3.0 || ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-25 01:33:06 UTC
README
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