Download the PHP package nmc9/nuvei-helper without Composer

On this page you can find all versions of the php package nmc9/nuvei-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package nuvei-helper

Based on this Library https://github.com/jqueguiner/PivotalPayment

Nuvei

PHP Library for Nuvei http://www.pivotalpayments.com/ca/fr/

Requirements

CURL (php_curl) XMLRPC (php_xmlrpc) Multibyte String PHP extension (php_mbstring)

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:

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 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

//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

Payment form helper is included in the library and is based on https://github.com/jessepollak/card plugin

card

//$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

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

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


All versions of nuvei-helper with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nmc9/nuvei-helper contains the following files

Loading the files please wait ...