PHPackages                             abraham-flutterwave/laravel-payment - 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. abraham-flutterwave/laravel-payment

ActiveLaravel-library[Payment Processing](/categories/payments)

abraham-flutterwave/laravel-payment
===================================

The Official Flutterwave Package for Laravel.

2.1.1(9mo ago)65.5k↓39.6%5[1 PRs](https://github.com/bajoski34/Laravel/pulls)1MITPHPPHP ^7.4 || ^8.0

Since Nov 15Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/bajoski34/Laravel)[ Packagist](https://packagist.org/packages/abraham-flutterwave/laravel-payment)[ RSS](/packages/abraham-flutterwave-laravel-payment/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (11)Used By (1)

 [![](https://camo.githubusercontent.com/608d40fd864915df0dbc4c5c36924fe5ab9a8fdf594182d6cd2e5f8750cea47d/68747470733a2f2f666c7574746572776176652e636f6d2f696d616765732f6c6f676f2f66756c6c2e737667 "Flutterwave")](https://camo.githubusercontent.com/608d40fd864915df0dbc4c5c36924fe5ab9a8fdf594182d6cd2e5f8750cea47d/68747470733a2f2f666c7574746572776176652e636f6d2f696d616765732f6c6f676f2f66756c6c2e737667)

Flutterwave Laravel.
====================

[](#flutterwave-laravel)

[![Packagist Downloads](https://camo.githubusercontent.com/c86f9c024cbae7fba90fc9f2a1bfc00483af5186e58de693b801727612d1e8cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6162726168616d2d666c7574746572776176652f6c61726176656c2d7061796d656e74)](https://camo.githubusercontent.com/c86f9c024cbae7fba90fc9f2a1bfc00483af5186e58de693b801727612d1e8cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6162726168616d2d666c7574746572776176652f6c61726176656c2d7061796d656e74)[![Packagist PHP Version Support](https://camo.githubusercontent.com/ead24b0352db9c801cff2d30a130f3d743e534b3058700d62ce66eefe7280339/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6162726168616d2d666c7574746572776176652f6c61726176656c2d7061796d656e74)](https://camo.githubusercontent.com/ead24b0352db9c801cff2d30a130f3d743e534b3058700d62ce66eefe7280339/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6162726168616d2d666c7574746572776176652f6c61726176656c2d7061796d656e74)[![GitHub stars](https://camo.githubusercontent.com/9fc4c1462e5595e5b3b13730677832a51ddc714636120480c2ce43290ebcf8c4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f62616a6f736b6933342f4c61726176656c)](https://camo.githubusercontent.com/9fc4c1462e5595e5b3b13730677832a51ddc714636120480c2ce43290ebcf8c4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f62616a6f736b6933342f4c61726176656c)[![Packagist License](https://camo.githubusercontent.com/baaa20c85ad68eb1a711f2045c2443c42b6706613f22fb77d0a608718a2e3573/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6162726168616d2d666c7574746572776176652f6c61726176656c2d7061796d656e74)](https://camo.githubusercontent.com/baaa20c85ad68eb1a711f2045c2443c42b6706613f22fb77d0a608718a2e3573/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6162726168616d2d666c7574746572776176652f6c61726176656c2d7061796d656e74)

This Flutterwave Laravel Package provides easy access to Flutterwave for Business (F4B) v3 APIs from Laravel apps. It abstracts the complexity involved in direct integration and allows you to make quick calls to the APIs.

Available features include:

- Collections: Card, Account, Mobile money, Bank Transfers, USSD, Barter, NQR.

Table of Contents
-----------------

[](#table-of-contents)

1. [Requirements](#requirements)
2. [Installation](#installation)
3. [Initialization](#initialization)
4. [Usage](#usage)
5. [Testing](#testing)
6. [Debugging Errors](#debugging-errors)
7. [Support](#support)
8. [Contribution guidelines](#contribution-guidelines)
9. [License](#license)
10. [Changelog](#changelog)

Requirements
------------

[](#requirements)

1. Flutterwave for business [API Keys](https://developer.flutterwave.com/docs/integration-guides/authentication)
2. Acceptable PHP versions: &gt;= 7.3

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

[](#installation)

The vendor folder is committed into the project to allow easy installation for those who do not have composer installed. It is recommended to update the project dependencies using:

```
$ composer require abraham-flutterwave/laravel-payment
```

Ensure that you publish your config file by running:

```
$ php artisan vendor:publish --provider="Flutterwave\Payments\Providers\FlutterwaveServiceProvider"
```

Initialization
--------------

[](#initialization)

In your .env file add the following environment variables:

```
FLW_PUBLIC_KEY="****YOUR**PUBLIC**KEY****" // can be gotten from the dashboard
FLW_SECRET_KEY="****YOUR**SECRET**KEY****" // can be gotten from the dashboard
FLW_ENCRYPTION_KEY="Encryption key"
FLW_ENVIRONMENT="development"
```

Business Settings/preferences like logo, name, payment method can be set in the config file `config/flutterwave.php`

```
'businessName' => env('FLW_BUSINESS_NAME', 'Flutterwave Store'),
'transactionPrefix' => env('FLW_TRANSACTION_PREFIX', 'LARAVEL-'),
'logo' => env('FLW_BUSINESS_LOGO', 'https://avatars.githubusercontent.com/u/39011309?v=4'),
'title' => env('FLW_PAYMENT_DESCRIPTOR', 'Flutterwave Store'),
'description' => env('FLW_CHECKOUT_DESCRIPTION', 'Flutterwave Store Description'),
'country' => env('FLW_DEFAULT_COUNTRY', 'NG'),
'currency' => env('FLW_DEFAULT_CURRENCY', Currency::NGN),
'paymentType' => [
    'card', 'account', 'banktransfer', 'mpesa', 'mobilemoneyrwanda', 'mobilemoneyzambia',
    'mobilemoneyuganda', 'ussd', 'qr', 'mobilemoneyghana', 'credit', 'barter',
    'payattitude', 'mobilemoneyfranco', 'mobilemoneytanzania', 'paga', '1voucher',
],
```

Usage
-----

[](#usage)

Render Payment Modal
--------------------

[](#render-payment-modal)

There are two types of modal that can be rendered, the inline modal and the standard modal. The inline modal is rendered on your website while the standard modal is rendered on a flutterwave hosted page.

### Inline Modal

[](#inline-modal)

```
use Flutterwave\Payments\Facades\Flutterwave;
use Flutterwave\Payments\Data\Currency;

$payload = [
    "tx_ref" => Flutterwave::generateTransactionReference(),
    "amount" => 100,
    "currency" => Currency::NGN,
    "customer" => [
        "email" => "developers@flutterwavego.com"
    ],
];

$payment_details = Flutterwave::render('inline', $payload);

return view('flutterwave::modal', compact('payment_details'));
```

### Standard Modal

[](#standard-modal)

```
use Flutterwave\Payments\Facades\Flutterwave;
use Flutterwave\Payments\Data\Currency;

$payload = [
    "tx_ref" => Flutterwave::generateTransactionReference(),
    "amount" => 100,
    "currency" => Currency::NGN,
    "customer" => [
        "email" => "developers@flutterwavego.com"
    ],
];

$payment_link = Flutterwave::render('standard', $payload);

return redirect($payment_link);
```

These are the routes available for integrating the Flutterwave payment system. Below is a breakdown of each route and its purpose.

### Checkout Route

[](#checkout-route)

URL: /flutterwave/payment/checkout

Method: POST (form-data)

Description: This route initiates the payment checkout process. The user will be required to send a POST request with the necessary payment details such as amount, currency, and email. If additional meta data is provided, it will be included in the request.

#### Parameters:

[](#parameters)

- amount (required): The payment amount.
- currency (required): The currency code (e.g., USD, NGN).
- email (required): The email address of the customer.
- meta (optional): Any custom data related to the payment. Response: Returns a view (flutterwave::modal) that contains the payment details and a Flutterwave inline payment form.

### Payment Callback Route

[](#payment-callback-route)

URL: /flutterwave/payment/callback

Method: GET

Description: This route handles the callback from Flutterwave after a payment attempt. It verifies the transaction status using the transaction reference (tx\_ref). Based on the result, it redirects the user to appropriate pages.

#### Parameters:

[](#parameters-1)

- tx\_ref (required): The transaction reference ID returned by Flutterwave. Response:

If the transaction is successful, the user is redirected to the success page (flutterwave.successful). If the transaction is pending, it may redirect the user to a page that will poll for the transaction's final status. If the transaction has failed, the user is redirected to the failure page (flutterwave.failed). 3. Payment Success Route URL: /flutterwave/payment/success

Method: GET

Description: This route is called when a payment is successfully completed.

Response: Returns a simple message, "Payment Successful".

### Payment Failed Route

[](#payment-failed-route)

URL: /flutterwave/payment/failed

Method: GET

Description: This route is called when a payment fails.

Response: Returns a simple message, "Payment Failed".

### Payment Cancelled Route

[](#payment-cancelled-route)

URL: /flutterwave/payment/cancel

Method: GET

Description: This route is called when a payment is cancelled by the user.

Response: Returns a simple message, "Payment Cancelled".

Logging
-------

[](#logging)

To enable logging, simple add the following to your config file `config/logging.php`

```
'flutterwave' => [
    'driver' => 'single',
    'path' => storage_path('logs/flutterwave.log'),
    'level' => 'debug',
],
```

Webhook Setup
-------------

[](#webhook-setup)

Create a Webhook url to receive payment notification on Payment events. Below is a sample of a webhook url implementation using the new package.

```
use Flutterwave\Payments\Facades\Flutterwave;
use Flutterwave\Payments\Data\Status;

Route::post('flutterwave/payment/webhook', function () {
    $method = request()->method();
    if ($method === 'POST') {
        //get the request body
        $body = request()->getContent();
        $webhook = Flutterwave::use('webhooks');
        $transaction = Flutterwave::use('transactions');
        //get the request signature
        $signature = request()->header($webhook::SECURE_HEADER);

        //verify the signature
        $isVerified = $webhook->verifySignature($body, $signature);

        if ($isVerified) {
            [ 'tx_ref' => $tx_ref, 'id' => $id ] = $webhook->getHook();
            [ 'status' => $status, 'data' => $transactionData ] = $transaction->verifyTransactionReference($tx_ref);

            $responseData = ['tx_ref' => $tx_ref, 'id' => $id];
            if ($status === 'success') {
                switch ($transactionData['status']) {
                    case Status::SUCCESSFUL:
                        // do something
                        //save to database
                        //send email
                        break;
                    case Status::PENDING:
                        // do something
                        //save to database
                        //send email
                        break;
                    case Status::FAILED:
                        // do something
                        //save to database
                        //send email
                        break;
                }
            }

            return response()->json(['status' => 'success', 'message' => 'Webhook verified by Flutterwave Laravel Package', 'data' => $responseData]);
        }

        return response()->json(['status' => 'error', 'message' => 'Access denied. Hash invalid'])->setStatusCode(401);
    }

    // return 404
    return abort(404);
})->name('flutterwave.webhook');
```

Testing
-------

[](#testing)

All of the SDK's tests are written with PHP's `phpunit` module. The tests currently test: `Modals`, `Webhooks`, `Transactions`,

They can be run like so:

```
phpunit
```

> **NOTE:** If the test fails for creating a subaccount, just change the `account_number` `account_bank` and `businesss_email` to something different

> **NOTE:** The test may fail for account validation - ` Pending OTP validation` depending on whether the service is down or not

Debugging Errors
----------------

[](#debugging-errors)

We understand that you may run into some errors while integrating our library. You can read more about our error messages [here](https://developer.flutterwave.com/docs/integration-guides/errors).

For `authorization` and `validation` error responses, double-check your API keys and request. If you get a `server` error, kindly engage the team for support.

Support
-------

[](#support)

For additional assistance using this library, contact the developer experience (DX) team via [email](mailto:developers@flutterwavego.com) or on [slack](https://bit.ly/34Vkzcg).

You can also follow us [@FlutterwaveEng](https://twitter.com/FlutterwaveEng) and let us know what you think 😊.

Contribution guidelines
-----------------------

[](#contribution-guidelines)

Read more about our community contribution guidelines [here](/CONTRIBUTING.md)

License
-------

[](#license)

By contributing to this library, you agree that your contributions will be licensed under its [MIT license](/LICENSE).

Copyright (c) Flutterwave Inc.

Flutterwave API References
--------------------------

[](#flutterwave-api--references)

- [Flutterwave API Documentation](https://developer.flutterwave.com)
- [Flutterwave Dashboard](https://app.flutterwave.com)

TODOs
-----

[](#todos)

1. Add other Flutterwave Services - card,transfer,subaccount,payoutsubaccounts,plans and momo
2. Console Commands - Webhooks, Make Payment, and Refunds.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance57

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~123 days

Recently: every ~41 days

Total

9

Last Release

295d ago

Major Versions

1.0.4 → 2.1.02025-02-11

1.x-dev → 2.1.12025-07-27

### Community

Maintainers

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

---

Top Contributors

[![bajoski34](https://avatars.githubusercontent.com/u/39011309?v=4)](https://github.com/bajoski34 "bajoski34 (63 commits)")

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/abraham-flutterwave-laravel-payment/health.svg)

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

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)

PHPackages © 2026

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