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 2mo 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 14% 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

3110d 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.4k5.6M651](/packages/sylius-sylius)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

59914.4M62](/packages/mollie-mollie-api-php)[brd6/notion-sdk-php

Notion SDK for PHP

5918.0k](/packages/brd6-notion-sdk-php)[wordpress/php-ai-client

A provider agnostic PHP AI client SDK to communicate with any generative AI models of various capabilities using a uniform API.

26236.6k14](/packages/wordpress-php-ai-client)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[darthsoup/php-whmcs-api

WHMCS API client for PHP

2317.3k4](/packages/darthsoup-php-whmcs-api)

PHPackages © 2026

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