PHPackages                             jaysparmar/flutterwave-sdk - 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. jaysparmar/flutterwave-sdk

ActiveLibrary[Payment Processing](/categories/payments)

jaysparmar/flutterwave-sdk
==========================

A light weight Custom Flutterwave library for PHP

01PHP

Since Mar 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jaysparmar/flutterwave-sdk)[ Packagist](https://packagist.org/packages/jaysparmar/flutterwave-sdk)[ RSS](/packages/jaysparmar-flutterwave-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Flutterwave SDK for PHP
=======================

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

🌟 Introduction
--------------

[](#-introduction)

The Flutterwave SDK is a robust, lightweight PHP library designed to simplify interactions with the Flutterwave Payment API. Built with developers in mind, this SDK provides a clean, intuitive interface for handling various financial operations seamlessly.

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

[](#-table-of-contents)

- [Overview](#-overview)
- [Features](#-features)
- [Requirements](#-requirements)
- [Installation](#-installation)
- [Configuration](#-configuration)
- [Usage Examples](#-usage-examples)
- [Supported Operations](#-supported-operations)
- [Error Handling](#-error-handling)
- [Security](#-security)
- [Contributing](#-contributing)
- [License](#-license)
- [Contact](#-contact)

🚀 Overview
----------

[](#-overview)

Flutterwave SDK offers developers a comprehensive toolkit to integrate Flutterwave's payment and financial services into their PHP applications. Whether you're building a fintech solution, an e-commerce platform, or need advanced payment routing, this library provides the tools you need.

✨ Features
----------

[](#-features)

### Financial Operations

[](#financial-operations)

- Account Balance Retrieval
- Transaction Management
- Virtual Account Creation
- Bill Payments
- Transfer Operations

### Card Services

[](#card-services)

- Virtual Card Creation
- Card Funding
- Card Transaction Tracking
- Card Block/Unblock
- Card Termination

### Verification Services

[](#verification-services)

- Bank Account Resolution
- BVN (Bank Verification Number) Verification
- OTP (One-Time Password) Sending and Verification

### Additional Capabilities

[](#additional-capabilities)

- Multi-Currency Support
- Webhook Integration
- Comprehensive Error Handling
- Flexible Configuration

🔧 Requirements
--------------

[](#-requirements)

- PHP 7.3 or higher
- Composer
- Flutterwave API Credentials
- cURL Extension

💾 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require jaysparmar/flutterwave-sdk
```

🔐 Configuration
---------------

[](#-configuration)

### Obtaining Credentials

[](#obtaining-credentials)

1. Log in to your Flutterwave Dashboard
2. Navigate to API Settings
3. Generate/Copy your:
    - Public Key
    - Secret Key
    - Encryption Key

### Initialization

[](#initialization)

```
use jaysparmar\flutterwave\Flutterwave;

$flutterwave = new Flutterwave(
    $public_key,        // Your Flutterwave public key
    $secret_key,        // Your Flutterwave secret key
    $encryption_key,    // Your Flutterwave encryption key
    $currency_code,     // Default currency (e.g., 'NGN')
    $card_webhook_url   // Webhook URL for card-related events
);
```

🛠 Usage Examples
----------------

[](#-usage-examples)

### 1. Account Balance

[](#1-account-balance)

```
// Retrieve balances for all supported currencies
$allBalances = $flutterwave->balances();

// Get balance for a specific currency
$nairaBalance = $flutterwave->balances('NGN');
```

### 2. Virtual Account Creation

[](#2-virtual-account-creation)

```
$virtualAccount = $flutterwave->create_virtual_account([
    'email' => 'user@example.com',
    'is_permanent' => true,
    'bvn' => '12345678901',
    'phonenumber' => '08109328188',
    'firstname' => 'John',
    'lastname' => 'Doe'
]);
```

### 3. Bill Payments

[](#3-bill-payments)

```
// List available bill types
$billTypes = $flutterwave->get_available_bills();

// Validate a bill
$validation = $flutterwave->validate_bill(
    $item_code,     // Item code from bill categories
    $biller_code,   // Specific biller code
    $customer_id    // Customer identifier
);

// Pay a bill
$billPayment = $flutterwave->pay_bill(
    'NG',           // Country code
    $customer_id,   // Customer identifier
    $bill_type,     // Bill type (airtime, power, etc.)
    $unique_ref,    // Unique transaction reference
    $amount         // Bill amount
);
```

### 4. Virtual Card Management

[](#4-virtual-card-management)

```
// Create a virtual card
$card = $flutterwave->create_virtual_card(
    $unique_ref,    // Unique reference for the card
    $currency,      // Card currency
    $initial_amount,// Initial funding amount
    $billing_name   // Cardholder name
);

// Fund a card
$fundCard = $flutterwave->fund_card(
    $amount,        // Funding amount
    $card_id        // Card identifier
);

// Block/Unblock a card
$blockCard = $flutterwave->block_card($card_id, 'block');
```

💱 Supported Currencies
----------------------

[](#-supported-currencies)

The SDK supports a wide range of currencies:

- NGN (Nigerian Naira)
- KES (Kenyan Shilling)
- GHS (Ghanaian Cedi)
- USD (US Dollar)
- EUR (Euro)
- ZAR (South African Rand)
- And many more...

🚨 Error Handling
----------------

[](#-error-handling)

All methods return a standardized response array:

```
[
    'error' => bool,       // Operation status
    'message' => string,   // Descriptive message
    'data' => array        // Response payload
]
```

### Example Error Handling

[](#example-error-handling)

```
$result = $flutterwave->some_method();

if ($result['error']) {
    // Handle error
    echo "Error: " . $result['message'];
} else {
    // Process successful response
    $data = $result['data'];
}
```

Flutterwave SDK for PHP
=======================

[](#flutterwave-sdk-for-php-1)

Other Available Functions
-------------------------

[](#other-available-functions)

### Transfer and Transaction Related Functions

[](#transfer-and-transaction-related-functions)

#### Transfer Rates

[](#transfer-rates)

```
// Check transfer rates between currencies
$transferRates = $flutterwave->transfer_rate(
    $amount,        // Amount to transfer
    $source_currency,       // Source currency code
    $destination_currency   // Destination currency code
);
```

#### Create Transfer

[](#create-transfer)

```
// Transfer funds to a bank account
$transfer = $flutterwave->create_transfer(
    $bank_code,     // Recipient bank code
    $account_number,// Recipient account number
    $amount,        // Transfer amount
    $txn_ref,       // Unique transaction reference
    $meta_data      // Additional metadata
);
```

#### Transfer Fees

[](#transfer-fees)

```
// Check transfer fees
$transferFees = $flutterwave->transfer_fees(
    $amount,        // Transfer amount
    $currency       // Currency code (default NGN)
);
```

### Bank and Account Related Functions

[](#bank-and-account-related-functions)

#### Resolve Account Number

[](#resolve-account-number)

```
// Validate and retrieve account details
$accountDetails = $flutterwave->resolve_account_number(
    $account_number,    // Account number
    $bank_code          // Bank code
);
```

#### Get All Banks

[](#get-all-banks)

```
// Retrieve list of banks (default Nigeria)
$banks = $flutterwave->get_all_banks($country_code);
```

#### Get Bank Branches

[](#get-bank-branches)

```
// Get branches for a specific bank
$branches = $flutterwave->get_bank_branches($bank_id);
```

### OTP (One-Time Password) Functions

[](#otp-one-time-password-functions)

#### Send OTP

[](#send-otp)

```
// Send OTP to user
$otp = $flutterwave->send_otp(
    $name,          // User's name
    $email,         // User's email
    $phone,         // User's phone number
    $medium         // Delivery methods (email, whatsapp, sms)
);
```

#### Verify OTP

[](#verify-otp)

```
// Verify the OTP
$verification = $flutterwave->verify_otp(
    $otp,           // OTP code
    $reference      // OTP reference
);
```

### Additional Specialized Functions

[](#additional-specialized-functions)

#### BVN Verification

[](#bvn-verification)

```
// Verify Bank Verification Number
$bvnVerification = $flutterwave->verify_bvn($bvn_number);
```

### Card Management Extended Examples

[](#card-management-extended-examples)

#### Get All Cards

[](#get-all-cards)

```
// Retrieve list of virtual cards
$cards = $flutterwave->get_all_cards($page_number);
```

#### Get Specific Card Details

[](#get-specific-card-details)

```
// Get details of a specific card
$cardDetails = $flutterwave->get_card($card_id);
```

#### Card Transactions

[](#card-transactions)

```
// Retrieve card transactions
$cardTransactions = $flutterwave->get_card_transactions(
    $card_id,               // Card identifier
    $from_date,             // Start date
    $to_date,               // End date
    $transactions_per_page, // Transactions per page
    $page_number            // Page number
);
```

#### Withdraw from Card

[](#withdraw-from-card)

```
// Withdraw funds from a virtual card
$withdrawal = $flutterwave->withdraw_from_card(
    $amount,    // Withdrawal amount
    $card_id    // Card identifier
);
```

### Comprehensive Transaction Retrieval

[](#comprehensive-transaction-retrieval)

```
// Retrieve transactions with multiple filters
$transactions = $flutterwave->get_all_transactions([
    'from' => '2023-01-01',
    'to' => '2023-12-31',
    'page' => 1,
    'customer_email' => 'user@example.com',
    'status' => 'successful',
    'currency' => 'NGN'
]);
```

Additional Notes on Function Usage
----------------------------------

[](#additional-notes-on-function-usage)

1. **Consistent Return Format**: All functions return an array with:

    - `error`: Boolean indicating success/failure
    - `message`: Descriptive message
    - `data`: Returned data or empty array
2. **Error Handling**: Always check the `error` key before processing the response.
3. **Currency Support**: Verify supported currencies before making transactions.
4. **Reference Management**: Generate unique references for transactions.

Webhook Integration
-------------------

[](#webhook-integration)

- All card and transfer operations support webhook callbacks
- Configure `$card_webhook_url` during initialization
- Implement webhook endpoint to receive real-time transaction updates

Supported Currencies Expanded
-----------------------------

[](#supported-currencies-expanded)

- NGN (Nigerian Naira)
- KES (Kenyan Shilling)
- GHS (Ghanaian Cedi)
- USD (US Dollar)
- EUR (Euro)
- ZAR (South African Rand)
- GBP (British Pound)
- And more: TZS, UGX, RWF, ZMW, INR, XOF, MUR, ETB, JPY, MAD, XAF, AUD, CAD, MYR, CNY, BRL, eNGN, MWK

---

**Pro Tip**: Always refer to the Flutterwave API documentation for the most up-to-date information on supported features and any changes in API behavior.

🔒 Security Considerations
-------------------------

[](#-security-considerations)

- Always keep your API credentials confidential
- Use environment variables for sensitive information
- Implement proper error logging
- Validate and sanitize all input data
- Use HTTPS for all API communications

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please follow these steps:

1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Open a Pull Request

### Development Guidelines

[](#development-guidelines)

- Follow PSR-12 coding standards
- Write comprehensive tests
- Update documentation
- Maintain backward compatibility

📄 License
---------

[](#-license)

Distributed under the MIT License. See `LICENSE` for more information.

📞 Contact &amp; Support
-----------------------

[](#-contact--support)

- **Author:** Jay Parmar
- **Email:**
- **Project Link:** [GitHub Repository](https://github.com/jaysparmar/flutterwave-sdk)

🙏 Acknowledgements
------------------

[](#-acknowledgements)

- [Flutterwave](https://flutterwave.com/) for their comprehensive API
- PHP and Composer communities
- All contributors and supporters

---

**Disclaimer:** This SDK is an independent library and is not officially maintained by Flutterwave. Always refer to the official Flutterwave documentation for the most up-to-date information.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1438e049ffea4ca708bfab39b37c2f95f63fe269241cdc5d46bd54371decd909?d=identicon)[bharticloud](/maintainers/bharticloud)

---

Top Contributors

[![infinitie-jay](https://avatars.githubusercontent.com/u/96616972?v=4)](https://github.com/infinitie-jay "infinitie-jay (2 commits)")

### Embed Badge

![Health badge](/badges/jaysparmar-flutterwave-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/jaysparmar-flutterwave-sdk/health.svg)](https://phpackages.com/packages/jaysparmar-flutterwave-sdk)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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