Search by

edydeyemi / laravel-paystack

Edydeyemi

A modern, fluent PHP/Laravel 13 package for integrating Paystack payments, subscriptions, transfers, subaccounts, dedicated virtual accounts, and webhooks.

Package info

github.com/Edydeyemi/laravel-paystack

pkg:composer/edydeyemi/laravel-paystack

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-11-25 01:07 UTC

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(), and miscellaneous().
  • Laravel HTTP Client Native: Built on Illuminate\Http\Client\Factory, so Http::fake() works seamlessly in tests.
  • Immutable Response Wrapper: PaystackResponse with ok(), status(), message(), dot-notated data() and meta(), ArrayAccess, and JsonSerializable.
  • 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(), and Amount::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:

  1. Installation, Configuration & Core Concepts
  2. Transactions & Refunds
  3. Customers, Plans & Subscriptions
  4. Transfers & Transfer Recipients
  5. Subaccounts & Transaction Splits
  6. Dedicated Virtual Accounts (DVA), Verification & Miscellaneous
  7. Webhooks & Laravel Events

Testing & Quality

composer test
composer analyse
composer format