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

ActiveLibrary[API Development](/categories/api)

clearhaus/sdk
=============

Clearhaus PHP SDK

v0.1.0(8y ago)1100[1 issues](https://github.com/RiskioFr/clearhaus-sdk-php/issues)[2 PRs](https://github.com/RiskioFr/clearhaus-sdk-php/pulls)MITPHPPHP ^7.0

Since Oct 5Pushed 5y ago3 watchersCompare

[ Source](https://github.com/RiskioFr/clearhaus-sdk-php)[ Packagist](https://packagist.org/packages/clearhaus/sdk)[ Docs](https://github.com/RiskioFr/clearhaus-sdk-php)[ RSS](/packages/clearhaus-sdk/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (1)Dependencies (10)Versions (5)Used By (0)

Clearhaus PHP SDK
=================

[](#clearhaus-php-sdk)

SDK for Clearhaus API written in PHP and decoupled from any HTTP messaging client using HTTPlug.

You can sign up for a Clearhaus account at .

[![Build Status](https://camo.githubusercontent.com/a8284ae2c012396ba5b1d2ae9aee72f39acdc897c7fe3788af6dcf87207582b8/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5269736b696f46722f636c656172686175732d73646b2d7068702e7376673f7374796c653d666c61742d737175617265)](http://travis-ci.org/RiskioFr/clearhaus-sdk-php)[![Latest Stable Version](https://camo.githubusercontent.com/6b179fded8a95386fdf52174a3aceac1f349e6035c31d1248ddd3be9cc7cde4b/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c656172686175732f73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/clearhaus/sdk)[![Total Downloads](https://camo.githubusercontent.com/170ad074e35aa54924657f11832fd08cbecfa7f8f52f76c2e9ca9cbb3c8937bd/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c656172686175732f73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/clearhaus/sdk)[![GitHub license](https://camo.githubusercontent.com/57e28574b91b7b2ee56049039538e3231bfc00d0feb469944722dd5c2fa06d0f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5269736b696f46722f636c656172686175732d73646b2d7068702e7376673f7374796c653d666c61742d737175617265)](https://github.com/RiskioFr/clearhaus-sdk-php/blob/master/LICENSE)

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

[](#requirements)

- PHP 7.0+
- [php-http/client-common ^1.3](https://github.com/php-http/client-common)
- [php-http/discovery ^1.0](https://github.com/php-http/discovery)
- [php-http/httplug ^1.0](https://github.com/php-http/httplug)

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

[](#installation)

Clearhaus SDK only officially supports installation through Composer. For Composer documentation, please refer to [getcomposer.org](http://getcomposer.org/).

You can install the module from command line:

```
$ composer require clearhaus/sdk
```

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

[](#documentation)

Please see  for up-to-date documentation.

### Authentication

[](#authentication)

For authentication, you must provide an API key that you will find in your account:

```
use Clearhaus\Client;

$client = new Client($apiKey);
```

### Signed requests

[](#signed-requests)

The signature is an RSA signature of the HTTP body; it is represented in Hex. The signee must be identified by the signing API-key.

```
use Clearhaus\Client;

$client->enableSignature();
```

### Authorizations

[](#authorizations)

To reserve money on a cardholder’s bank account you make a new authorization resource.

```
$authorization = $client->authorizations->authorize([
    'amount' => 2050,
    'currency' => 'EUR',
    'ip' => '1.1.1.1',
    'card' => [
        'number' => '4111111111111111',
        'expire_month' => '06',
        'expire_year' => '2018',
        'csc' => '123',
    ],
]);
```

You can also use a card previously tokenized.

```
$authorization = $client->authorizations->authorizeFromCardId($cardId, [
    'amount' => 2050,
    'currency' => 'EUR',
    'ip' => '1.1.1.1',
]);
```

### Captures

[](#captures)

To transfer money from a cardholder’s bank account to your merchant bank account you make a new capture resource. You can make multiple captures for an authorization transaction.

```
$client->captures->capture($authorization['id']);
```

You can withdraw a partial amount by providing an amount parameter:

```
$client->captures->capture($authorization['id'], ['amount' => 1000]);
```

### Refunds

[](#refunds)

To refund money to a cardholder’s bank account you make a new refund resource. You can make multiple refunds for an authorization transaction.

```
$client->refunds->refund($authorization['id']);
```

You can refund a partial amount by providing an amount parameter:

```
$client->refunds->refund($authorization['id'], ['amount' => 500]);
```

### Voids

[](#voids)

To release reserved money on a cardholder’s bank account you make a new void resource. A reservation normally last for 7 days depending on issuing bank and is then automatically released.

```
$client->voids->void($authorization['id']);
```

### Credits

[](#credits)

To payout (e.g. winnings and not refunds) money to a cardholder’s bank account you make a new credit resource. You must have a card resource to make a credit transaction.

```
$client->credits->credit($card['id'], [
    'amount' => 2050,
    'currency' => 'EUR',
]);
```

### Cards

[](#cards)

A card resource (token) corresponds to a payment card and can be used to make a credit or authorization transaction without providing sensitive card data. A card resource must be used to make subsequent recurring authorization transactions.

```
$card = $client->cards->createCard([
    'card' => [
        'number' => '4111111111111111',
        'expire_month' => '06',
        'expire_year' => '2018',
        'csc' => '123',
    ],
]);
```

### Accounts

[](#accounts)

The account resource holds basic merchant account information.

```
$account = $client->accounts->getAccount();
```

### 3-D Secure

[](#3-d-secure)

3-D Secure is a protocol designed to improve security for online transactions. Before you continue please read more about this protocol at [3Dsecure.io](http://docs.3dsecure.io/).

To perform a 3-D Secure transaction you make an ordinary authorization including a pares value:

```
$authorization = $client->authorizations->authorize([
    'amount' => 2050,
    'currency' => 'EUR',
    'ip' => '1.1.1.1',
    'card' => [
        'number' => '4111111111111111',
        'expire_month' => '06',
        'expire_year' => '2018',
        'csc' => '123',
    ],
    'threed_secure' => [
        'pares' => '',
    ],
]);
```

PSR-11 factory
--------------

[](#psr-11-factory)

You can use the predefined factory `Clearhaus\Container\ClientFactory` to instantiate a Clearhaus client:

```
use Clearhaus\Container\ClientFactory;

$factory = new ClientFactory();
$client = $factory($psrContainer);
```

The client configuration must look like below:

```
use Clearhaus\Client;

return [
    'clearhaus_sdk' => [
        'api_key' => null, // Allow to provide API key that you will find in your account
        'mode' => Client::MODE_TEST, // Allow to define the usage of either test or live accounts
        'use_signature' => true, // Allow to configure the usage of request signature
        'plugins' => [], // HTTPlug plugins that allow to add some processing logic
    ],
];
```

Testing
-------

[](#testing)

```
$ vendor/bin/phpspec run
```

Credits
-------

[](#credits-1)

- [Nicolas Eeckeloo](https://github.com/neeckeloo)
- [All Contributors](https://github.com/RiskioFr/clearhaus-sdk-php/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/RiskioFr/clearhaus-sdk-php/blob/master/LICENSE) for more information.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

3157d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1768645?v=4)[Nicolas Eeckeloo](/maintainers/neeckeloo)[@neeckeloo](https://github.com/neeckeloo)

---

Top Contributors

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

---

Tags

capturecardclearhaus-apihttplugmoneyrefundsdk-phpapicloudpaymentgatewaytransactionclearhaus

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M728](/packages/sylius-sylius)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[brd6/notion-sdk-php

Notion SDK for PHP

6123.0k](/packages/brd6-notion-sdk-php)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k28.0M309](/packages/openai-php-client)[apigee/apigee-client-php

Client library for connecting to the Apigee Edge API.

27584.5k4](/packages/apigee-apigee-client-php)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9067.8k](/packages/n1ebieski-ksef-php-client)

PHPackages © 2026

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