PHPackages                             nps/php-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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. nps/php-sdk

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

nps/php-sdk
===========

A Php SDK for Ingenico ePayments - NPS LatAm Services

1.3.0(7y ago)951.5k↓35%1[1 issues](https://github.com/Ingenico-NPS-Latam/nps-sdk-php/issues)MITPHPPHP &gt;=5.3.0

Since Dec 19Pushed 4y ago4 watchersCompare

[ Source](https://github.com/Ingenico-NPS-Latam/nps-sdk-php)[ Packagist](https://packagist.org/packages/nps/php-sdk)[ Docs](https://developers.nps.com.ar/)[ RSS](/packages/nps-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (35)Used By (0)

PHP SDK
=======

[](#php-sdk)

Availability
------------

[](#availability)

Supports PHP 5.3 and above

How to install
--------------

[](#how-to-install)

Pre Requesites
--------------

[](#pre-requesites)

You will have to install the following packages for your PHP:

### · SimpleXML

[](#-simplexml)

### · Curl

[](#-curl)

### · Soap

[](#-soap)

Composer installation
---------------------

[](#composer-installation)

the SDK can be installed with [Composer](http://getcomposer.org/) by updating your composer.json file

```
{
    "require":
        {
            "nps/php-sdk": "1.3.0"
        }
}
```

or by executing this command

```
$ composer require nps/php-sdk
```

Manual installation
-------------------

[](#manual-installation)

You can download or clone the SDK from our [Github Page](https://github.com/Ingenico-NPS-Latam/nps-sdk-php). and then include the `init.php` file.

```
require_once __DIR__ . '/vendor/autoload.php';
```

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

[](#configuration)

It's a basic configuration of the SDK

```
require_once __DIR__ . '/vendor/autoload.php';
use NpsSDK\Configuration;
use NpsSDK\Constants;
Configuration::environment(Constants::STAGING_ENV);
Configuration::secretKey(“yourSecretKeyHere”);
```

Here is an simple example request:

```
require_once __DIR__ . '/vendor/autoload.php';

use NpsSDK\Sdk;
use NpsSDK\ApiException;
use NpsSDK\Configuration;
use NpsSDK\Constants;

Configuration::environment(Constants::SANDBOX_ENV);
Configuration::secretKey("YourKeyhere");

$sdk = new Sdk();

$params = array(
    'psp_Version'          => '2.2',
    'psp_MerchantId'       => 'psp_test',
    'psp_TxSource'         => 'WEB',
    'psp_MerchTxRef'       => 'ORDER56666-3',
    'psp_MerchOrderId'     => 'ORDER56666',
    'psp_Amount'           => '1000',
    'psp_NumPayments'      => '1',
    'psp_Currency'         => '032',
    'psp_Country'          => 'ARG',
    'psp_Product'          => '14',
    'psp_CustomerMail'     => 'john.doe@example.com',
    'psp_CardNumber'       => '4507990000000010',
    'psp_CardExpDate'      => '1903',
    'psp_CardSecurityCode' => '306',
    'psp_SoftDescriptor'   => 'Sol Tropical E',
    'psp_PosDateTime'      => '2016-12-01 12:00:00'

);
try{
    $resp = $sdk->payOnline2p($params);
}catch(ApiException $e){
    echo 'Code to handle error';
}
```

Environments
------------

[](#environments)

```
require_once __DIR__ . '/vendor/autoload.php';

use NpsSDK\Configuration;
use NpsSDK\Constants;
Configuration::environment(Constants::STAGING_ENV);
Configuration::environment(Constants::SANDBOX_ENV);
Configuration::environment(Constants::PRODUCTION_ENV);
```

Error handling
--------------

[](#error-handling)

ApiException: This exception is raised when a ReadTimeout or a ConnectTimeout occurs.

Note: The rest of the exceptions that can occur will be detailed inside of the response provided by NPS or will be provided by the php SoapClient class.

```
require_once __DIR__ . '/vendor/autoload.php';

use NpsSDK\ApiException;

//Code
try{
    //code or sdk call
}catch(ApiException $e){
    //Code to handle error
}
```

Advanced configurations
-----------------------

[](#advanced-configurations)

### Logging

[](#logging)

Nps SDK allows you to log what’s happening with you request inside of our SDK, it logs by default to stout. The SDK uses the custom logger that you use for your project.

An example for monolog Logger.

```
use Monolog\Logger;
$logger = new Logger(“NpsSdk”);

use NpsSDK\Configuration;

Configuration::secretKey(“your key here”);
Configuration::logger($logger);
```

### LogLevel

[](#loglevel)

Note: The logger needs to be PSR-3 compliant to work properly inside of the SDK, some examples are (Monolog, Analog).

The "INFO" level will write concise information of the request and will mask sensitive data of the request. The "DEBUG" level will write information about the request to let developers debug it in a more detailed way.

```
use NpsSDK\Configuration;

Configuration::secretKey(“your key here”);
Configuration::loglevel(“DEBUG”);
```

### Sanitize

[](#sanitize)

Sanitize allows the SDK to truncate to a fixed size some fields that could make request fail, like extremely long name.

```
use NpsSDK\Configuration;

Configuration::secretKey(“your key here”);
Configuration::sanitize(true);
```

### Timeout

[](#timeout)

You can change the timeout of the request.

ExecutionTimeout(Default=60 seconds): you can change the execution timeout of the request.

ConnectionTimeout(Default=10 seconds): you can change the connection timeout of the request.

```
use NpsSDK\Configuration;

Configuration::secretKey(“your key here”);
Configuration::executionTimeout(60);
Configuration::connectionTimeout(10);
```

### Proxy configuration

[](#proxy-configuration)

```
use NpsSDK\Configuration;

Configuration::secretKey(“your key here”);
Configuration::proxyUrl("http://yourproxy");
Configuration::proxyPort(6854);
Configuration::proxyUser("proxyUsername");
Configuration::proxyPass("proxyPassword");
```

### Cache

[](#cache)

```
use NpsSDK\Configuration;

Configuration::secretKey(“your key here”);
Configuration::useCache(True);
Configuration::cacheTTL(86400);
Configuration::cacheLocation("/tmp");
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~22 days

Recently: every ~81 days

Total

34

Last Release

2691d ago

Major Versions

0.1.1 → 1.0.02017-01-09

### Community

Maintainers

![](https://www.gravatar.com/avatar/460ea2bb35a88f6c081d5e8cb77fe55c31929f3946d25214220befecf8a52f71?d=identicon)[WorldlineLatam](/maintainers/WorldlineLatam)

---

Top Contributors

[![diazchg](https://avatars.githubusercontent.com/u/16945887?v=4)](https://github.com/diazchg "diazchg (6 commits)")[![jmrebull](https://avatars.githubusercontent.com/u/14167311?v=4)](https://github.com/jmrebull "jmrebull (2 commits)")

---

Tags

argentinacreditcardingenicolatammonolognpspayment-gatewaypaymentsphp-sdksdkapipayment processingNPSingenico

### Embed Badge

![Health badge](/badges/nps-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/nps-php-sdk/health.svg)](https://phpackages.com/packages/nps-php-sdk)
```

###  Alternatives

[treblle/security-headers

A collection of HTTP middleware classes to improve the security headers in your Laravel application.

9534.3k](/packages/treblle-security-headers)[moesif/moesif-laravel

Moesif Collection/Data Ingestion Middleware for Laravel

1065.8k](/packages/moesif-moesif-laravel)

PHPackages © 2026

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