PHPackages                             nmc9/nuvei-helper - 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. nmc9/nuvei-helper

ActiveLibrary[API Development](/categories/api)

nmc9/nuvei-helper
=================

Helpers to intergate with Nuvei

v1.6.1(5y ago)124MITPHP

Since May 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/nmc9/Nuvei-Helper)[ Packagist](https://packagist.org/packages/nmc9/nuvei-helper)[ RSS](/packages/nmc9-nuvei-helper/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)DependenciesVersions (5)Used By (0)

Based on this Library

Nuvei
=====

[](#nuvei)

PHP Library for Nuvei

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

[](#requirements)

CURL (php\_curl) XMLRPC (php\_xmlrpc) Multibyte String PHP extension (php\_mbstring)

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

[](#installation)

Place the content of the github repo into the desired directory in your projet ($DIR) Create a transaction table if needed in your DB (SQL model file in located under:

- Data/dataModel.sql

Live Usage
----------

[](#live-usage)

```
//$DIR see section installation below
require_once($DIR.DIRECTORY_SEPARATOR.'Pivotal.php');

$paymentParams['ORDERID'] = $orderId;
$paymentParams['AMOUNT'] = $amount;
$paymentParams['CURRENCY'] = $currency;
$paymentParams['CARDNUMBER'] = $cardNumber;
$paymentParams['CARDHOLDERNAME'] = $cardHolderName;
//month two digits (09 for september)
$paymentParams['MONTH'] = $cardMonth;
//year two digits (16 for 2016)
$paymentParams['YEAR'] = $cardYear;
//CVV 3 or 4 Digits depending on vendor
$paymentParams['CVC'] = $cardCVC;

//'live' for live environment
//'test' for test environment
$pivotal = new Pivotal('live',$paymentParams);

//configure your db to autosave transactions
$pivotal->_dbConfig = array('server' => 'localhost', 'login' => 'root', 'password' => 'root', 'database' => 'myDb');

//transactions won't be saved in the DB
$response = $pivotal->sendPayment();

//transactions will be saved in the DB
//true option stands for transaction recording in the database (table is "transaction" see installation section")
$response = $pivotal->sendPayment(true);

```

Test Usage
----------

[](#test-usage)

Test cards are included in the library:

```
//$DIR see section installation below
require_once($DIR.DIRECTORY_SEPARATOR.'Pivotal.php');

$pivotal_config = new Pivotal_Config('test');

//get test card number for the selected vendor (Visa)
//get the holdername and CVV too
//all test variables are under the Data Directory (TestCards.json)
//live and Test URL are in Data Directory (MainConfig.json)
//live and Test terminals are in Data Directory (Terminals.json)

$card = $pivotal_config->readVendorTestCard('visa');

$paymentParams['ORDERID'] = rand(10,10000);
$paymentParams['AMOUNT'] = 1000;
$paymentParams['CURRENCY'] = 'CAD';
$paymentParams['CARDNUMBER'] = $card['CardNumber'];
$paymentParams['CARDHOLDERNAME'] = $card['CardHolderName'];
$paymentParams['MONTH'] = '09';
$paymentParams['YEAR'] = '16';
$paymentParams['CVC'] = $card['CVC'];

$pivotal = new Pivotal('test',$paymentParams);

$response = $pivotal->sendPayment();

```

Payment validation Output
-------------------------

[](#payment-validation-output)

```
//if success
array(
	'UNIQUEREF' => 'GW5CWTXWIW',
	'RESPONSECODE' => 'A',
	'RESPONSETEXT' => 'APPROVAL',
	'APPROVALCODE' => '475318',
	'DATETIME' => '2014-11-10T17:25:58',
	'AVSRESPONSE' => 'X',
	'CVVRESPONSE' => 'M',
	'HASH' => 'b035f8f72f4be9df404d6268b55c02b0',
	'STATUS' => true
)

or
//if error
array(
	'ERRORSTRING' => 'The error description',
	'STATUS' => false
)

```

Building Payment Form
---------------------

[](#building-payment-form)

Payment form helper is included in the library and is based on  plugin

[![card](https://camo.githubusercontent.com/7c29d31d71eacbdd16edf273c9d52833e55ecea9305685da44d244f91fa18d10/687474703a2f2f692e696d6775722e636f6d2f71473354656e4f2e676966)](https://camo.githubusercontent.com/7c29d31d71eacbdd16edf273c9d52833e55ecea9305685da44d244f91fa18d10/687474703a2f2f692e696d6775722e636f6d2f71473354656e4f2e676966)

```
//$DIR see section installation below
require_once($DIR.DIRECTORY_SEPARATOR.'Helper'.DIRECTORY_SEPARATOR.'form.php');

//$action = formAction see http://www.w3schools.com/tags/att_form_action.asp for more info
$action = 'PaymentProcessURL.php';

$pivotal_form = new Pivotal_Form($action);
echo $pivotal_form->buildForm();

```

Extra
-----

[](#extra)

This Lib also provide Regex to detect card vendor (REGEX are located in Data/CardTypes.json) and you can read the vendor based on the Card Number

```
//$DIR see section installation below
require_once($DIR.DIRECTORY_SEPARATOR.'Pivotal.php');

$pivotal_config = new Pivotal_Config('test');

//this clean and compare the card number to regular expression config located under Data/CardTypes.json
//please feel free to add new credit card type but keep in mind the the order in the CardTypes.json is important and that last pattern found = output
//so be sure to have VISA, MASTERCARD before resellers (VISA DEBIT is part of VISA for instance which means that VISA should be before VISA DEBIT)

$vendor = $pivotal_config->getCardType('1234567890123456');

```

Credit Card Regex
-----------------

[](#credit-card-regex)

Here are the credit card regex known so far, please feel free to contribute to make this lib even more accurate.

- Maestro
- JCB
- Diners
- American
- Express
- Visa
- MasterCard
- Debit MasterCard
- UK Domestic Maestro
- Solo

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 67.4% 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 ~143 days

Total

4

Last Release

2133d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8516265?v=4)[Nicholas Caruso](/maintainers/nmc9)[@nmc9](https://github.com/nmc9)

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

---

Top Contributors

[![jqueguiner](https://avatars.githubusercontent.com/u/690878?v=4)](https://github.com/jqueguiner "jqueguiner (31 commits)")[![nmc9](https://avatars.githubusercontent.com/u/8516265?v=4)](https://github.com/nmc9 "nmc9 (15 commits)")

---

Tags

nuvei

### Embed Badge

![Health badge](/badges/nmc9-nuvei-helper/health.svg)

```
[![Health](https://phpackages.com/badges/nmc9-nuvei-helper/health.svg)](https://phpackages.com/packages/nmc9-nuvei-helper)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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