PHPackages                             stephenjude/laravel-payment-gateways - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. stephenjude/laravel-payment-gateways

ActiveLibrary[Payment Processing](/categories/payments)

stephenjude/laravel-payment-gateways
====================================

A simple Laravel API implementation for all payment providers like Paystack, Flutterwave, &amp; Paypal etc.

4.0.1(2mo ago)1105.2k↓20%26MITPHPPHP ^8.1|^8.2|^8.3|^8.4CI failing

Since May 25Pushed 2d ago4 watchersCompare

[ Source](https://github.com/stephenjude/laravel-payment-gateways)[ Packagist](https://packagist.org/packages/stephenjude/laravel-payment-gateways)[ Docs](https://github.com/stephenjude/laravel-payment-gateways)[ RSS](/packages/stephenjude-laravel-payment-gateways/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (24)Versions (71)Used By (0)

Laravel Payment Gateways
========================

[](#laravel-payment-gateways)

[![Latest Version on Packagist](https://camo.githubusercontent.com/669ba7fe1aee93c438ea63d4866a8ae6c98ce71356f8d1dd684019c2468101f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7374657068656e6a7564652f6c61726176656c2d7061796d656e742d67617465776179732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stephenjude/laravel-payment-gateways)[![GitHub Tests Action Status](https://camo.githubusercontent.com/04371e41eb251be4538f683f4d840fb679aee9e3b26db0dacddae16f89dd648f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7374657068656e6a7564652f6c61726176656c2d7061796d656e742d67617465776179732f72756e2d74657374732e796d6c3f6c6162656c3d7465737473)](https://github.com/stephenjude/laravel-payment-gateways/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/7d3dd0453124bbf0a861a272f214e04abec7211ce96645489b88a6ed453509a3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7374657068656e6a7564652f6c61726176656c2d7061796d656e742d67617465776179732f7068702d63732d66697865722e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/stephenjude/laravel-payment-gateways/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/55eba61266298b97e14db1164d96e2af99aed7958cb0453e7055197d58cc9f63/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7374657068656e6a7564652f6c61726176656c2d7061796d656e742d67617465776179732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/stephenjude/laravel-payment-gateways)

A simple Laravel implementation for all payment providers. This package supports Paystack, Monnify, Pay4Me Pay, Seerbit, Flutterwave, Klasha, and Stripe.

Use Case
--------

[](#use-case)

Have you had to implement limited SDKs to accept payments in your mobile app? That's the problem this package solved.

With this package, you can generate a payment link and return it to your mobile app API call, and the payment can be completed on the in-app browser.

When the customer completes their payment, this package verifies the payment and executes the code defined inside your custom closure.

The closure should look like this:

```
use Stephenjude\PaymentGateway\DataObjects\TransactionData;

function (TransactionData $payment){
    $order->update([
        'status' => $payment->status,
        'amount' => $payment->amount,
        'currency' => $payment->currency
    ]);

    $customer->notify(new OrderPaymentNotification($order));
}
```

If you are using this package on the web, this closure is the place where you can return a redirect after updating the customer order or sending a notification.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require stephenjude/laravel-payment-gateways
```

You can publish the config file with:

```
php artisan vendor:publish --tag="payment-gateways-config"
```

Optionally, you can publish the views using

```
php artisan vendor:publish --tag="payment-gateways-views"
```

Usage
-----

[](#usage)

This package currently supports `paystack`, `monnify`, `pay4me`, `seerbit`, `flutterwave`, `klasha` and `stripe`.

### How to initialize a payment session

[](#how-to-initialize-a-payment-session)

```
use Stephenjude\PaymentGateway\PaymentGateway;
use Stephenjude\PaymentGateway\DataObjects\TransactionData;

$provider = PaymentGateway::make('paystack')

$paymentSession = $provider->initializeCheckout([
    'currency' => 'NGN', // required
    'amount' => 100, // required
    'email' => 'customer@email.com', // required
    'meta' => [ 'name' => 'Stephen Jude', 'phone' => '081xxxxxxxxx'],
    'closure' => function (TransactionData $payment){
        /*
         * Payment verification happens immediately after the customer makes payment.
         * The payment data obtained from the verification will be injected into this closure.
         */
        logger('payment details', [
           'currency' => $payment->currency,
           'amount' => $payment->amount,
           'status' => $payment->status,
           'reference' => $payment->reference,
           'provider' => $payment->provider,
           'date' => $payment->date,
        ]);
    },
]);

$paymentSession->provider;
$paymentSession->checkoutUrl;
$paymentSession->expires;
```

### Accessing payment transaction data

[](#accessing-payment-transaction-data)

```
$provider = PaymentGateway::make('paystack');

$transactions = $provider->listTransactions(); // Returns array

$transaction = $provider->findTransaction(REFERENCE); // Returns Stephenjude\PaymentGateway\DataObjects\TransactionData
$transaction->provider;
$transaction->email;
$transaction->amount;
$transaction->currency;
$transaction->reference;
$transaction->status;
$transaction->date;
```

### Pawapay Setup

[](#pawapay-setup)

Required Env Variables

```
PAWAPAY_SECRET=

```

Checkout

```
use \Stephenjude\PaymentGateway\Enums\Provider;
use \Stephenjude\PaymentGateway\PaymentGateway;

$pawapay = PaymentGateway::make(Provider::PAWAPAY())->initializeCheckout([
    "amount" => 15,
    "country" => "ZMB",
    'meta' => [
        "description" => "Note of 4 to 22 chars",
        "reason" => "Ticket to festival"
    ]
]);
```

### Pay4Me Setup

[](#pay4me-setup)

```
PAY4ME_PUBLIC=
PAY4ME_SECRET=

```

### Monnify Setup

[](#monnify-setup)

```
MONNIFY_PUBLIC=
MONNIFY_SECRET=
MONNIFY_CONTRACT_CODE=

```

### Pay4Me Setup

[](#pay4me-setup-1)

```
SEERBIT_PUBLIC=
SEERBIT_SECRET=

```

### Paystack Setup

[](#paystack-setup)

```
PAYSTACK_PUBLIC=
PAYSTACK_SECRET=

```

### Flutterwave Setup

[](#flutterwave-setup)

```
FLUTTERWAVE_PUBLIC=
FLUTTERWAVE_SECRET=

```

### Klasha Setup

[](#klasha-setup)

```
KLASHA_PUBLIC=
KLASHA_SECRET=

```

### Stripe Setup

[](#stripe-setup)

```
STRIPE_PUBLIC=
STRIPE_SECRET=

```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [stephenjude](https://github.com/stephenjude)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance92

Actively maintained with recent releases

Popularity39

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 88.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~45 days

Total

69

Last Release

88d ago

Major Versions

0.1.8 → 1.0.02022-08-27

1.0.17 → 2.0.02023-03-07

2.2.1 → 3.0.02024-04-24

3.1.2 → 4.0.02025-11-29

PHP version history (5 changes)0.0.1PHP ^8.0|^8.1

2.0.0PHP ^8.0|^8.1|^8.2

2.1.0PHP ^8.1|^8.2

3.0.0PHP ^8.1|^8.2|8.3

4.0.0PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/eb8b712638a0d72afbc4e21574989fdfc33717a69ea3070e92104183db8068f9?d=identicon)[stephenjude](/maintainers/stephenjude)

---

Top Contributors

[![stephenjude](https://avatars.githubusercontent.com/u/31182887?v=4)](https://github.com/stephenjude "stephenjude (301 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (13 commits)")[![eyounelson](https://avatars.githubusercontent.com/u/24621192?v=4)](https://github.com/eyounelson "eyounelson (4 commits)")

---

Tags

laravelstephenjudelaravel-payment-gateways

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/stephenjude-laravel-payment-gateways/health.svg)

```
[![Health](https://phpackages.com/badges/stephenjude-laravel-payment-gateways/health.svg)](https://phpackages.com/packages/stephenjude-laravel-payment-gateways)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

815320.5k3](/packages/defstudio-telegraph)[ralphjsmit/laravel-glide

Auto-magically generate responsive images from static image files.

4923.6k5](/packages/ralphjsmit-laravel-glide)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[danestves/laravel-polar

A package to easily integrate your Laravel application with Polar.sh

8118.0k](/packages/danestves-laravel-polar)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

43140.3k](/packages/harris21-laravel-fuse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
