PHPackages                             khalesartem/mtls-hmac-client - 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. khalesartem/mtls-hmac-client

ActiveLibrary[Payment Processing](/categories/payments)

khalesartem/mtls-hmac-client
============================

PHP 8.2+ payment gateway client with mTLS transport security and HMAC signatures. Supports automatic ENV configuration fallback.

v1.0.1(4mo ago)03MITPHPPHP ^8.1

Since Dec 12Pushed 4mo agoCompare

[ Source](https://github.com/KhalesArtem/mtls-hmac-client)[ Packagist](https://packagist.org/packages/khalesartem/mtls-hmac-client)[ RSS](/packages/khalesartem-mtls-hmac-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

payment-mtls-hmac-client
========================

[](#payment-mtls-hmac-client)

Install
-------

[](#install)

```
composer require khalesartem/mtls-hmac-client:dev-main
```

Usage
-----

[](#usage)

```
use Payment\MtlsHmac\Client\GatewayClient;
use Payment\MtlsHmac\Config\GatewayConfig;

$config = new GatewayConfig(
    hmacSecret: 'my-secret',
    certPath: '/path/client-cert.pem',
    keyPath: '/path/client-key.pem',
    keyPassphrase: 'badssl.com', // optional
    verify: true,
    hmacAlgo: 'sha256',
    signatureHeader: 'X-Signature',
);

$client = new GatewayClient($config);
$response = $client->get('https://client.badssl.com/', [
    'transaction_id' => '12345',
    'amount' => '99.99',
    'currency' => 'USD',
]);

echo $response->getStatusCode();
echo (string) $response->getBody();
```

Run tests
---------

[](#run-tests)

```
composer install
./vendor/bin/phpunit
```

Integration test uses `.env` (copy from `.env.example`) and will be **skipped** if required variables/files are missing.

Environment Variables
---------------------

[](#environment-variables)

Configure these variables in your `.env` file:

```
GATEWAY_ENDPOINT=https://your-gateway.com/api
GATEWAY_HMAC_SECRET=your-hmac-secret
GATEWAY_CERT_PATH=/path/to/client-cert.pem
GATEWAY_KEY_PATH=/path/to/client-key.pem
GATEWAY_KEY_PASSPHRASE=optional-passphrase
GATEWAY_VERIFY=true
GATEWAY_HMAC_ALGO=sha256
GATEWAY_SIGNATURE_HEADER=X-Signature
```

Example Script
--------------

[](#example-script)

Run the included example:

```
php example.php
```

This demonstrates both environment-based and manual configuration approaches.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance74

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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

149d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6c584ae099cfe29c5aef4a65116622447822d3a5555181e48176734e06242e26?d=identicon)[KhalesArtem](/maintainers/KhalesArtem)

---

Top Contributors

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

---

Tags

securitysslpaymentgatewayhmacphp8mtls

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/khalesartem-mtls-hmac-client/health.svg)

```
[![Health](https://phpackages.com/badges/khalesartem-mtls-hmac-client/health.svg)](https://phpackages.com/packages/khalesartem-mtls-hmac-client)
```

###  Alternatives

[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)

PHPackages © 2026

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