PHPackages                             hydrogenafrica/hydrogenpay-ci4 - 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. hydrogenafrica/hydrogenpay-ci4

ActiveLibrary[Payment Processing](/categories/payments)

hydrogenafrica/hydrogenpay-ci4
==============================

Hydrogenpay SDK integration for CodeIgniter 4 applications

v1.0.1(10mo ago)01MITPHPPHP ^7.4 || ^8

Since Jul 16Pushed 10mo agoCompare

[ Source](https://github.com/HydrogenAfrica/hydrogenpay-ci4)[ Packagist](https://packagist.org/packages/hydrogenafrica/hydrogenpay-ci4)[ Docs](https://hydrogenpay.com)[ RSS](/packages/hydrogenafrica-hydrogenpay-ci4/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Hydrogenpay SDK for CodeIgniter 4
=================================

[](#hydrogenpay-sdk-for-codeigniter-4)

Hydrogenpay PHP SDK for CodeIgniter 4 makes it easy to connect your apps to the Hydrogenpay APIs.
It simplifies integration, so you can quickly collect payments, handle payouts, and more — all in just a few lines of code.

Features
--------

[](#features)

OperationDescription**Single Payment**Create a one-time payment request using either card or bank transfer.**Recurring Payment**Set up a subscription-based payment request for card payments.**Cancel Recurring**Cancel a recurring transaction or deactivate a card token associated with a recurring payment.**Simulate Transfer**To test the bank transfer functionality during the development phase of integrating the Payment Gateway.**Initiate Transfer**Generate unique account details to receive transfer-only payment requests.**Payment Confirmation**Confirm and validate the status of a completed card or transfer payment.**Payment Webhook**The webhook allows you to receive instant notifications about payment status from the payment gateway.---

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

[](#table-of-contents)

1. [Requirements](#requirements)
2. [Installation](#installation)
3. [Usage](#usage)
4. [Contributing](#contributing)
5. [License](#license)
6. [API References](#api-references)

---

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

[](#requirements)

- PHP &gt;= ^8.0
- CodeIgniter 4
- [Hydrogenpay API keys](https://docs.hydrogenpay.com/reference/api-authentication)

---

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

[](#installation)

Install via Composer:

```
composer require hydrogenafrica/hydrogenpay-ci4
```

Then copy the provided .env.example file to .env and update with your Hydrogenpay credentials:

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

Example .env settings:

```
LIVE_API_KEY=SK_LIVE_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
SANDBOX_KEY=PK_TEST_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
MODE=TEST
```

- LIVE\_API\_KEY: Your HydrogenPay live API key obtained from the dashboard. (Required)
- SANDBOX\_KEY: Your HydrogenPay sandbox API key obtained from the dashboard. (Required)
- MODE: Defines the environment mode. Set to LIVE to use the LIVE\_API\_KEY or TEST to use the SANDBOX\_KEY. (Required)

Usage
-----

[](#usage)

### Single Payment

[](#single-payment)

Create a one-time payment request using either card or bank transfer.

First, import the class:

```
use HydrogenAfrica\HydrogenpayCi4\Hydrogenpay\CollectPayment;
```

Then initiate a payment:

```
 $data = [
            'amount'          => 50,
            'customer_name'   => 'Dev Test',
            'customer_email'  => 'devtest@randomuser.com',
            'currency'        => 'NGN',
            'description'     => 'test desc',
            'meta'            => 'test meta',
            'callback'        => base_url('verify'), // must match your app's route
        ];

        # return CollectPayment::standard($data);
        $result = CollectPayment::recurring($data); // get JSON string
        $decoded = json_decode($result);

        echo "\n==== Raw decoded response ====\n";
        var_dump($decoded);

```

### Recurring Payment

[](#recurring-payment)

Set up a subscription-based payment request for card payments.

First, import the class:

```
use HydrogenAfrica\HydrogenpayCi4\Hydrogenpay\CollectPayment;
```

```
$data = [
            'amount'          => 50,
            'customer_name'   => 'Dev Test',
            'customer_email'  => 'devtest@randomuser.com',
            'currency'        => 'NGN',
            'description'     => 'Weekly subscription',
            'meta'            => 'subscription_id:5678',
            'callback'        => base_url('verify'), // must match your app's route
            'frequency'       => 1,
            'is_recurring'    => true,
            'end_date'        => '2025-08-14T23:59:59Z',
        ];

        return CollectPayment::recurring($data);

```

### Cancel Recurring

[](#cancel-recurring)

Cancel a recurring transaction or deactivate a card token associated with a recurring payment.

First, import the class:

```
use HydrogenAfrica\HydrogenpayCi4\Hydrogenpay\CollectPayment;
```

```
        $transactionRef = '36934683_76927e4cf6'; // Replace this with a real transactionRef

        if (empty($transactionRef)) {
            $this->fail('transactionRef is empty. Please replace with a real transactionRef to test cancelRecurring.');
        }

        $result = CollectPayment::cancelRecurring([
            'transactionRef' => $transactionRef,
            'token' => '2c382ed1-b5e5-4050-81fb-1b4d61443429',
        ]);

        $decoded = json_decode($result);

        echo "\n==== Cancel Recurring Response ====\n";
        var_dump($decoded);
```

### Initiate Transfer

[](#initiate-transfer)

Generate unique account details to receive transfer-only payment requests.

First, import the class:

```
use HydrogenAfrica\HydrogenpayCi4\Hydrogenpay\CollectPayment;
```

```
        $data = [
            'amount'         => 50,
            'customer_name'  => 'Dev Test',
            'email'          => 'devtest@randomuser.com',
            'currency'       => 'NGN',
            'description'    => 'Bank transfer test',
            'meta'           => 'order_id:1234',
            'callback'       => base_url('verify'),
        ];

        $result = CollectPayment::bankTransfer($data);
        $decoded = json_decode($result);

        echo "\n==== Bank Transfer Response ====\n";
        var_dump($decoded);
```

### Simulate Transfer

[](#simulate-transfer)

To test the bank transfer functionality during the development phase of integrating the Payment Gateway. Developers are required to select the bank transfer method at the payment checkout stage before making the request

First, import the class:

```
use HydrogenAfrica\HydrogenpayCi4\Hydrogenpay\CollectPayment;
```

```
         $data = [
            'clientTransactionRef' => '36934683_774526591e', // A unique trax ref for the client’s transaction
            'currency'             => 'NGN',
            'amount'               => 50,
        ];

        $result = CollectPayment::simulateBankTransfer($data);
        $decoded = json_decode($result);

        echo "\n==== Raw decoded response ====\n";
        var_dump($decoded);
```

### Payment Confirmation

[](#payment-confirmation)

Confirm and validate the status of a completed card or transfer payment.

First, import the class:

```
use HydrogenAfrica\HydrogenpayCi4\Hydrogenpay\CollectPayment;
```

```

        $transactionRef = '36934683_76927e4cf6'; // Replace with a real transaction ref

        try {
            $verification = Verification::transaction($transactionRef);

            // Dump some fields so you can see
            echo "\nVerified Transaction Ref: " . $verification->transactionRef() . "\n";
            echo "Status: " . $verification->status() . "\n";
            echo "Amount: " . $verification->amount() . "\n";

        } catch (Exception $e) {
            // Fail the test with the exception message
            $this->fail('Verification failed: ' . $e->getMessage());
        }
```

### Payment Webhook

[](#payment-webhook)

The webhook allows you to receive instant notifications about payment status from the payment gateway.

First, import the class:

```
use HydrogenAfrica\HydrogenpayCi4\Hydrogenpay\CollectPayment;
```

```

   //Verify Webhook
if (Webhook::verifyWebhook())
   {
      // Continue reading the webhook data
      Webhook::data()->status();

   }

```

API References
--------------

[](#api-references)

- [Hydrogenpay Dashboard](https://dashboard.hydrogenpay.com/)
- [Hydrogenpay Developer Docs](https://docs.hydrogenpay.com/reference/api-authentication)

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

[](#contributing)

Feel free to add more test cases, edge scenarios, or submit improvements! Pull requests are welcome.

License
-------

[](#license)

© HydrogenPay – All rights reserved.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance55

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

300d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/993dbc828a5005f47ecfda31e65c96f49f1a71e3469053a7fa2afe5f7d1bb086?d=identicon)[YusufLawal](/maintainers/YusufLawal)

---

Top Contributors

[![lawalyusuf](https://avatars.githubusercontent.com/u/44825869?v=4)](https://github.com/lawalyusuf "lawalyusuf (3 commits)")

---

Tags

phpsdkpaymentscodeigniter4hydrogenpay

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/hydrogenafrica-hydrogenpay-ci4/health.svg)

```
[![Health](https://phpackages.com/badges/hydrogenafrica-hydrogenpay-ci4/health.svg)](https://phpackages.com/packages/hydrogenafrica-hydrogenpay-ci4)
```

###  Alternatives

[kingflamez/laravelrave

A Laravel Package for Flutterwave Rave

151286.1k4](/packages/kingflamez-laravelrave)[yandex-money/yandex-money-sdk-php

Yandex.Money API SDK for PHP

105167.4k2](/packages/yandex-money-yandex-money-sdk-php)[tatter/stripe

Stripe SDK integration for CodeIgniter 4

115.3k](/packages/tatter-stripe)[cryptonator/merchant-php-sdk

Cryptonator.com Merchant API SDK for PHP

2713.7k](/packages/cryptonator-merchant-php-sdk)

PHPackages © 2026

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