PHPackages                             alfallouji/php\_optimal\_netbanx - 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. alfallouji/php\_optimal\_netbanx

ActiveLibrary[Payment Processing](/categories/payments)

alfallouji/php\_optimal\_netbanx
================================

An OOP PHP Client for the Card payments Optimal Netbanx Restful service

0.0.8(11y ago)15.6k—0%2LGPL-2.1PHPPHP &gt;=5.3.0

Since Feb 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/alfallouji/PHP-Optimal-Netbanx)[ Packagist](https://packagist.org/packages/alfallouji/php_optimal_netbanx)[ RSS](/packages/alfallouji-php-optimal-netbanx/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)DependenciesVersions (9)Used By (0)

[![Build Status](https://camo.githubusercontent.com/a1361b86f5dc7a400116fb05aea9e00706a36a4b831678136a82bd3691afb6b8/68747470733a2f2f7472617669732d63692e6f72672f616c66616c6c6f756a692f5048502d4f7074696d616c2d4e657462616e782e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/alfallouji/PHP-Optimal-Netbanx)

PHP-Optimal-Netbanx
===================

[](#php-optimal-netbanx)

This is an OOP PHP Client for the Card payments Optimal Netbanx Restful service.

Authors &amp; contact
---------------------

[](#authors--contact)

Al-Fallouji Bashar -

Documentation and download
--------------------------

[](#documentation-and-download)

Latest version is available on github at : -

License
-------

[](#license)

This Code is released under the GNU LGPL

Please do not change the header of the file(s).

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU Lesser General Public License for more details.

How to setup
------------

[](#how-to-setup)

You can use composer to use this library.

```
{
    "require": {
		"alfallouji/php_optimal_netbanx": "*"
    }
}

```

You can use composer to generate autoload map files.

`composer dumpautoload`

How to start
------------

[](#how-to-start)

This PHP client works with the Netbanx service (card payments).

You will need an account with Optimal Payment in order to use this library.

You can create testing account here :

Configuration
-------------

[](#configuration)

In order for you to use the NETBANX REST API, NETBANX must first set you up on their system and provide you with an API key. Your API key looks something like this:

- Key ID – MerchantXYZ
- Key Password – B-tst1-0-51ed39e4-312d02345d3f123120881dff9bb4020a89e8ac44cdfdcecd702151182fdc952272661d290ab2e5849e31bb03deede7
- Account ID - 12345678

They are available from :

Please note that on the Optimal My Account page, the API key contains the Key ID and the Key Password. It has the following the format :

`API_KEY_ID:API_KEY_PASSWORD`

Sample
------

[](#sample)

For an example, you can look at the tests/Functional folder.

```
/**
 * Helper function for test
 *
 * @param boolean $v Value to assert
 *
 * @return void
 */
function assertTest($v)
{
    if ($v)
    {
        echo "\t[OK]" . PHP_EOL;
    }
    else
    {
        echo "\t[FAILED]" . PHP_EOL;
        exit(-1);
    }
}

$auth = new \Optimal\Netbanx\Model\Authorization();
$auth->merchantRefNum = 'refNum_' . uniqid();
$auth->amount = 10000 + rand(200, 3000);
$auth->settleWithAuth = false;
$card = new \Optimal\Netbanx\Model\Card();
$card->cardNum = '4530910000012345';
$card->type = 'VI';
$card->lastDigits = '2345';
$expiry = new \Optimal\Netbanx\Model\CardExpiry();
$expiry->month = 11;
$expiry->year = 2019;
$card->cardExpiry = $expiry;
$auth->card = $card;
$billingDetails = new \Optimal\Netbanx\Model\BillingDetails();
$billingDetails->street = '511 rue abelard';
$billingDetails->zip = 'H3E 1B6';
$billingDetails->city = 'Verdun';
$billingDetails->country = 'CA';
$auth->billingDetails = $billingDetails;
$httpClient = new \Optimal\Netbanx\Client\Http($config['apiKey'], $config['apiPassword'], $config['accountId'], 'staging');
$service = new \Optimal\Netbanx\Service\Authorization($httpClient);

// Test 1 - create auth
echo PHP_EOL . 'Testing Authorization creation for ' . $auth->amount;
$result = $service->create($auth);
$id = isset($result['result']['id']) ? $result['result']['id'] : null;
assertTest($id);

// Test 2 - get auth
echo PHP_EOL . 'Testing Authorization get for ' . $id;
$result = $service->get($id);
$getId = isset($result['result']['id']) ? $result['result']['id'] : null;
assertTest($getId && $getId == $id);

// Test 3 - partial reverse of auth
$authReversal = new \Optimal\Netbanx\Model\AuthorizationReversal();
$authReversal->id = $getId;
$authReversal->amount = rand(500, 1000);
$authReversal->merchantRefNum = 'Reverse_for_' . $auth->merchantRefNum;
echo PHP_EOL . 'Testing Authorization reverse for an amount of ' . $authReversal->amount;
$result = $service->reverse($getId, $authReversal);
assertTest(isset($result['result']['status']) && $result['result']['status'] == 'COMPLETED');

// Test 4 - settle authorization
echo PHP_EOL . 'Testing Authorization settlement';
$result = $service->settle($id, array('merchantRefNum' => $auth->merchantRefNum));
assertTest($result['code'] == 200 && isset($result['result']['id']));```

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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

Every ~9 days

Recently: every ~15 days

Total

8

Last Release

4030d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bebcc8cf570598bb2bfba1406fd023100cb0d5b8ce5793308c6b962bea381be3?d=identicon)[alfallouji](/maintainers/alfallouji)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/alfallouji-php-optimal-netbanx/health.svg)

```
[![Health](https://phpackages.com/badges/alfallouji-php-optimal-netbanx/health.svg)](https://phpackages.com/packages/alfallouji-php-optimal-netbanx)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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