PHPackages                             flutterwavedev/flutterwave-v3 - 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. flutterwavedev/flutterwave-v3

ActiveLibrary[Payment Processing](/categories/payments)

flutterwavedev/flutterwave-v3
=============================

A simple SDK for integrating to Flutterwave Payment

1.1.0(1y ago)24174.1k↑12.9%22[1 PRs](https://github.com/Flutterwave/PHP-v3/pulls)3MITPHPPHP ^7.4 || ^8.0 || ^8.1CI passing

Since Sep 17Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/Flutterwave/PHP-v3)[ Packagist](https://packagist.org/packages/flutterwavedev/flutterwave-v3)[ Docs](https://github.com/Flutterwave/Flutterwave-PHP-v3)[ RSS](/packages/flutterwavedev-flutterwave-v3/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (17)Versions (13)Used By (3)

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

Flutterwave v3 PHP SDK.
=======================

[](#flutterwave-v3-php-sdk)

[![Packagist Downloads](https://camo.githubusercontent.com/71d580ae76e4bf347e8c4f5d4dc80af0e207ba57e3c67011aae843c466f2f981/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666c7574746572776176656465762f666c7574746572776176652d7633)](https://camo.githubusercontent.com/71d580ae76e4bf347e8c4f5d4dc80af0e207ba57e3c67011aae843c466f2f981/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f666c7574746572776176656465762f666c7574746572776176652d7633)[![Packagist PHP Version Support](https://camo.githubusercontent.com/86521aa27639259166be4a3995ada1947a7735a3a18c664aee6644fb00c7745f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f666c7574746572776176656465762f666c7574746572776176652d7633)](https://camo.githubusercontent.com/86521aa27639259166be4a3995ada1947a7735a3a18c664aee6644fb00c7745f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f666c7574746572776176656465762f666c7574746572776176652d7633)[![GitHub stars](https://camo.githubusercontent.com/1d4bf50e955152bff9c572eea620b80e44a95bdd6ff41c55fe489f70bc017f82/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f466c7574746572776176652f466c7574746572776176652d5048502d7633)](https://camo.githubusercontent.com/1d4bf50e955152bff9c572eea620b80e44a95bdd6ff41c55fe489f70bc017f82/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f466c7574746572776176652f466c7574746572776176652d5048502d7633)[![Packagist License](https://camo.githubusercontent.com/c7a6f8aa2a65e52f64cbc47f8ca9e429ad038f54fcaf831d1e7204f17f232c85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666c7574746572776176656465762f666c7574746572776176652d7633)](https://camo.githubusercontent.com/c7a6f8aa2a65e52f64cbc47f8ca9e429ad038f54fcaf831d1e7204f17f232c85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666c7574746572776176656465762f666c7574746572776176652d7633)

This Flutterwave v3 PHP Library provides easy access to Flutterwave for Business (F4B) v3 APIs from php 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.
- Payouts and Beneficiaries.
- Recurring payments: Tokenization and Subscriptions.
- Split payments
- Card issuing
- Transactions dispute management: Refunds.
- Transaction reporting: Collections, Payouts, Settlements, and Refunds.
- Bill payments: Airtime, Data bundle, Cable, Power, Toll, E-bills, and Remitta.
- Identity verification: Resolve bank account, resolve BVN information.

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.4.0. for older versions of PHP use the [Legacy Branch](https://github.com/Flutterwave/PHP-v3/tree/legacy)

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

[](#installation)

### Download Release Artifact

[](#download-release-artifact)

If you do not want to make use of composer. each [release](https://github.com/Flutterwave/PHP-v3/releases/) contains a zip with all the dependencies installed. Simply download the one that supports your php version.

### Installation via Composer.

[](#installation-via-composer)

To install the package via Composer, run the following command:

```
composer require flutterwavedev/flutterwave-v3
```

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

[](#initialization)

Create a .env file and follow the format of the `.env.example` file Save your PUBLIC\_KEY, SECRET\_KEY, ENV in the `.env` file

```
cp .env.example .env
```

Your `.env` file should look this. Make sure to retrieve your API keys from your dashboard.

```
FLW_PUBLIC_KEY=FLWSECK_TEST-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X
FLW_SECRET_KEY=FLWPUBK_TEST-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-X
FLW_ENCRYPTION_KEY=FLWSECK_XXXXXXXXXXXXXXXX
FLW_ENV='staging/production'
FLW_LOG_DIR=logs
```

### Render Payment Modal

[](#render-payment-modal)

The SDK provides two easy methods of making collections via the famous payment modal. [Learn more](#)

1. [Flutterwave Inline](https://developer.flutterwave.com/docs/collecting-payments/inline)
2. [Flutterwave Standard](https://developer.flutterwave.com/docs/collecting-payments/standard)

### Get Started

[](#get-started)

Edit the `paymentForm.php` and `processPayment.php` files to suit your purpose. Both files are well documented.

Simply redirect to the `paymentForm.php` file on your browser to process a payment.

In this implementation, we are expecting a form encoded POST request to this script. The request will contain the following parameters.

```
 {
    "amount": "The amount required to be charged. (*)",
    "currency": "The currency to charge in. (*)",
    "first_name": "The first name of the customer. (*)",
    "last_name" : "The last name of the customer. (*)",
    "email": "The customers email address. (*)",
    "phone_number": "The customer's phone number. (Optional).",
    "success_url": "The url to redirect customer to after successful payment.",
    "failure_url": "The url to redirect customer to after a failed payment.",
    "tx_ref":"The unique transaction identifier. if ommited the apiclient would generate one"
 }
```

The script in `paymentProcess.php` handles the request data via the `PaymentController`. If you are using a Framework like Laravel or CodeIgniter you might want to take a look at the [PaymentController](#)

```
