
Flutterwave v3 PHP SDK.
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
Requirements
Flutterwave for business API Keys
Acceptable PHP versions: >= 7.4.0. for older versions of PHP use the Legacy Branch
Installation
Download Release Artifact
If you do not want to make use of composer. each release contains a zip with all the dependencies installed. Simply download the one that supports your php version.
Installation via Composer.
To install the package via Composer, run the following command:
Initialization
Create a .env file and follow the format of the
.env.example file Save your PUBLIC_KEY, SECRET_KEY, ENV in the .env fileYour
.env file should look this. Make sure to retrieve your API keys from your dashboard.Render Payment Modal
The SDK provides two easy methods of making collections via the famous payment modal. Learn more
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.
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 PaymentControllerConfiguration settings
Create a .env file and add the bootstrap method first before initiating a charge.
if you do not wish to use a .env, you can simply pass your API keys like the example below.
Usage
Charge
Resources
Testing
All of the SDK's tests are written with PHP's
phpunit module. The tests currently test: Account, Card, Transfer, Preauth, Collection Subaccount, Payout Subaccount, Subscriptions and PaymentplanThey can be run like so:
NOTE: If the test fails for creating a subaccount, just change the
account_number account_bank and businesss_email to something differentNOTE: The test may fail for account validation -
Pending OTP validation depending on whether the service is down or notDebugging Errors
We understand that you may run into some errors while integrating our library. You can read more about our error messages here.
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
You can also follow us @FlutterwaveEng and let us know what you think 😊.
Contribution guidelines
Read more about our community contribution guidelines here
License
By contributing to this library, you agree that your contributions will be licensed under its MIT license.
Copyright (c) Flutterwave Inc.
Flutterwave API References
0 likes · 16 views · Sep 9, 2025
Developed a PHP SDK for easy integration with Flutterwave v3 APIs.