PHPackages                             nuvei/nuvei-server-php - 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. nuvei/nuvei-server-php

ActiveLibrary[API Development](/categories/api)

nuvei/nuvei-server-php
======================

A PHP client library for accessing Nuvei API

3.2.2(9mo ago)13100.4k↓29%24[4 issues](https://github.com/Nuvei/nuvei-server-php/issues)[4 PRs](https://github.com/Nuvei/nuvei-server-php/pulls)MITPHPPHP &gt;=5.4

Since Oct 4Pushed 9mo ago4 watchersCompare

[ Source](https://github.com/Nuvei/nuvei-server-php)[ Packagist](https://packagist.org/packages/nuvei/nuvei-server-php)[ Docs](https://github.com/Nuvei/nuvei-server-php)[ RSS](/packages/nuvei-nuvei-server-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (28)Used By (0)

Nuvei REST API SDK for PHP
==========================

[](#nuvei-rest-api-sdk-for-php)

Nuvei’s REST API SDK for PHP provides developer tools for accessing Nuvei's REST API. Nuvei’s REST API is a simple, easy-to-use, secure and stateless API, which enables online merchants and service providers to process consumer payments through Nuvei’s digital payment Gateway. The API supports merchants of all levels of PCI certification, online and mobile merchant applications, and is compatible with a large variety of payment options, such as payment cards and alternative payment methods. For Nuvei REST API documentation, please see:

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

[](#requirements)

PHP 5.4 or later.

Installation
============

[](#installation)

### Installation via Composer

[](#installation-via-composer)

```
composer require nuvei/nuvei-server-php
```

### Manual

[](#manual)

If you do not wish to use Composer, you can download the [latest release](https://github.com/Nuvei/nuvei-server-php/releases), and then include the `init.php` file.

```
require_once('/path/to/nuvei-sdk/init.php');
```

Dependencies
------------

[](#dependencies)

The PHP SDK requires the following extensions to work properly:

- [`curl`](https://secure.php.net/manual/en/book.curl.php)
- [`json`](https://secure.php.net/manual/en/book.json.php)

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

[](#configuration)

### Client

[](#client)

```
$client = new \Nuvei\Api\RestClient([
    'environment'       => \Nuvei\Api\Environment::TEST,
    'merchantId'        => '',
    'merchantSiteId'    => '',
    'merchantSecretKey' => '',
]);
```

Or

```
$client = new \Nuvei\Api\RestClient();
$config = $client->getConfig();
$config->setEnvironment(\Nuvei\Api\Environment::TEST);
$config->setMerchantId('');
$config->setMerchantSiteId('');
$config->setMerchantSecretKey('');
```

### Logger

[](#logger)

Logger can be configured with a [PSR-3 compatible logger](http://www.php-fig.org/psr/psr-3/) .

#### Example with Monolog

[](#example-with-monolog)

```
$logger = new Monolog\Logger('nuvei-php-sdk');
$logger->pushHandler(new Monolog\Handler\StreamHandler('path/to/log', Monolog\Logger::DEBUG));
$client->setLogger($logger);
```

Example
-------

[](#example)

Nuvei's PHP SDK appends merchantId, merchantSiteId, timestamp, and checksum in the request.

```
