PHPackages                             hosannahighertech/gateway-php - 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. hosannahighertech/gateway-php

ActiveLibrary[Payment Processing](/categories/payments)

hosannahighertech/gateway-php
=============================

Hosanna e-Payment Gateway API PHP library

1.0.3(8y ago)214MITPHP

Since Apr 28Pushed 8y agoCompare

[ Source](https://github.com/hosannahighertech/gateway-php)[ Packagist](https://packagist.org/packages/hosannahighertech/gateway-php)[ RSS](/packages/hosannahighertech-gateway-php/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Hosanna e-Payment Gateway PHP library
=====================================

[](#hosanna-e-payment-gateway-php-library)

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

[](#requirements)

PHP 5.4.0 and later.

Composer
--------

[](#composer)

You can install the library via [Composer](http://getcomposer.org/). Run the following command:

```
composer require hosannahighertech/gateway-php
```

To use the library, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require_once('vendor/autoload.php');
```

Dependencies
------------

[](#dependencies)

The library depends on [`Requests Http Library`](http://requests.ryanmccue.info/). The Library is included so you dont have to install anything.

Getting Started
---------------

[](#getting-started)

### 1. Creating gateway Object.

[](#1-creating-gateway-object)

To create the Gateway object you need to first define your configurations. Your configurations Object must implement `hosannahighertech\gateway\interfaces\ConfigurationInterface`. This gives you flexibility to use file, session or database to store your configurations. It also does not limit on how to get such a thing as access token though you can use the bundled library for that. See `src/samples` for an exmple. Assuming your configuration class is `SampleConfiguration` then you can create gateway object as simple as

```
use hosannahighertech\gateway\Gateway;
use hosannahighertech\gateway\samples\SampleConfigurations; //Your configuration file

$gateway = new Gateway(new SampleConfigurations());
```

The Gateway object can then be used for creating Payment requests and Confirming for Receipts.

### 2. Sending Payment Request

[](#2-sending-payment-request)

To create Payment request, just create an object of `PaymentRequest` class and then use gateway `sendRequest` method to send that. The method returns object of `RequestReceipt` containing, upon success or a `null` upon failure. Use Gateway object's `getError` method to get the actual error message.

```
use hosannahighertech\Gateway\PaymentRequest;

$request = new PaymentRequest();
$request = $request->setCard('1234565432789054')
				 ->setDescription('Buying some soda')
				 ->setAmount(1500)
				 ->setCurrency("TZS")
				 ->setCompany(1)
				 ->setTransferTo(1234567890987654);

$reqReceipt = $gateway->sendRequest($request);
if($reqReceipt === null)
{
	echo $gateway->getError());
}
else
{
	//succesfully. Do something with Request Receipt
}
```

### 3. Confirming Payment

[](#3-confirming-payment)

Confirming Payment will do the actual deducting/transfer of the money. To do that, just pass payment ID from `RequestReceipt` object you got from previous request, using `getReceipt()` method to `confirmPayment` method of the Gateway object. The result will be `null` in case of failure and an object of `PaymentReceipt` class in case of success. Use Gateway object's `getError` method to get the actual error message.

```
$paymentReceipt = $gateway->confirmPayment($reqReceipt->getReceipt());
if($paymentReceipt === null)
{
	echo $gateway->getError());
}
else
{
	//succesfully. Do something with Payment Receipt
}
```

Please refer to documentation for more details.

Documentation
-------------

[](#documentation)

Coming soon!

### 4. Loging

[](#4-loging)

TBD

### 5. Testing

[](#5-testing)

TBD

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity66

Established project with proven stability

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 ~0 days

Total

4

Last Release

2986d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8c021a0fa6c1e35d69de6a6027e607b9f14efe6844c9072246d7f795c29809d3?d=identicon)[Stefano Mtangoo](/maintainers/Stefano%20Mtangoo)

---

Tags

payment-gatewaypaymentsphp-librarytanzania

### Embed Badge

![Health badge](/badges/hosannahighertech-gateway-php/health.svg)

```
[![Health](https://phpackages.com/badges/hosannahighertech-gateway-php/health.svg)](https://phpackages.com/packages/hosannahighertech-gateway-php)
```

###  Alternatives

[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)

PHPackages © 2026

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