PHPackages                             floodx92/kh-gateway - 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. [API Development](/categories/api)
4. /
5. floodx92/kh-gateway

ActiveLibrary[API Development](/categories/api)

floodx92/kh-gateway
===================

v1.0.0(2y ago)111MITPHPPHP &gt;=8.1

Since May 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/floodx92/kh-gateway)[ Packagist](https://packagist.org/packages/floodx92/kh-gateway)[ RSS](/packages/floodx92-kh-gateway/feed)WikiDiscussions master Synced 2d ago

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

KhGateway
=========

[](#khgateway)

This package provides a simple way to interact with the K&amp;H Bank Gateway API. This package is not affiliated with K&amp;H Bank in any way.

Use the official docs to understand the full payment flow: [K&amp;H Official documentation](https://github.com/khpos/Payment-gateway_HU/wiki)

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

[](#requirements)

- PHP 8.1 or higher

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

[](#installation)

You can install the package via composer:

```
composer require floodx92/kh-gateway
```

Usage
-----

[](#usage)

First, you need to instantiate `CurlHttpClient` and `OpenSSLAdapter` classes. You can always use `new ClassName()` or `ClassName::make()` to instantiate a class.

```
use Floodx92\KhGateway\Util\CurlHttpClient;
use Floodx92\KhGateway\Crypto\OpenSSLAdapter;
use Floodx92\KhGateway\ApiService;
use Floodx92\KhGateway\Storage\FileKeyStorage;

// Instantiate the Http client, with the API URL
$client = CurlHttpClient::make(ApiService::SANDBOX_URL);
//client = CurlHttpClient::make(ApiService::PRODUCTION_URL);

// For the OpenSSLAdapter, first we need a KeyStore
$keyStore = FileKeyStorage::make(
    'path/to/your/private.key',
    'path/to/your/public.key',
    //optionally you can pass a passphrase as last argument
)
$adapter = OpenSSLAdapter::make($keyStore, $verifySignature = true);
```

Then, you can use the `ApiService` class to send requests to the API.

```
use Floodx92\KhGateway\ApiService;
use Floodx92\KhGateway\Model\Request\EchoRequest;
use Floodx92\KhGateway\Exception\HttpException;

$api = ApiService::make($adapter, $client);

// Send an Echo request
$echoRequest = EchoRequest::make($merchantId = 'ABC123456')
try {
    $echoResult = $api->echo($echoRequest);
    echo $echoResult->resultCode;
} catch (HttpException $e) {
    // Handle the exception
}
```

Error Handling
--------------

[](#error-handling)

All methods can throw a `HttpException` in case of a cURL error or when an HTTP error status code is received. You should catch this exception and handle it appropriately in your code.

TODO
----

[](#todo)

- Add tests
- Add more documentation
- Better JSON mapping for the responses

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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

780d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47539249?v=4)[Boncz Bálint](/maintainers/floodx92)[@floodx92](https://github.com/floodx92)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/floodx92-kh-gateway/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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