nps-sdk-perl
Perl Server-side SDK
Status: Under Development
Perl SDK
Availability
Supports Perl TBD
How to install
TBD
Configuration
It's a basic configuration of the SDK
use NpsSDK::Nps;
use warnings;
use strict;
NpsSDK::Configuration::configure(environment => $NpsSDK::Constants::SANDBOX_ENV,
secret_key => "_YOUR_SECRET_KEY_");
Here is an simple example request:
use NpsSDK::Nps;
use warnings;
use strict;
NpsSDK::Configuration::configure(environment => $NpsSDK::Constants::SANDBOX_ENV,
secret_key => "swGYxNeehNO8fS1zgwvCICevqjHbXcwPWAvTVZ5CuULZwKWaGPmXbPSP8i1fKv2q");
my $params = {
'psp_Version' => '2.2',
'psp_MerchantId' => 'psp_test',
'psp_TxSource' => 'WEB',
'psp_MerchTxRef' => 'ORDER69461-3',
'psp_MerchOrderId' => 'ORDER69461',
'psp_Amount' => '15050',
'psp_NumPayments' => '1',
'psp_Currency' => '032',
'psp_Country' => 'ARG',
'psp_Product' => '14',
'psp_CardNumber' => '4507990000000010',
'psp_CardExpDate' => '1612',
'psp_PosDateTime' => '2016-12-01 12:00:00',
'psp_CardSecurityCode' => '123'
};
my $response = NpsSDK::Nps::pay_online_2p($params);
environments
use NpsSDK::Nps;
$NpsSDK::Constants::PRODUCTION_ENV
$NpsSDK::Constants::STAGING_ENV
$NpsSDK::Constants::SANDBOX_ENV
Advanced configurations
Nps SDK allows you to log what’s happening with you request inside of our SDK, it logs by default to stout.
TBD
If you have the debug option enabled, the sdk can write the output generated from the logger to the file you provided.
TBD
The logging.INFO level will write concise information of the request and will mask sensitive data of the request. The logging.DEBUG level will write information about the request to let developers debug it in a more detailed way.
TBD
Sanitize allows the SDK to truncate to a fixed size some fields that could make request fail, like extremely long name.
use NpsSDK::Nps;
NpsSDK::Configuration::configure(environment => $NpsSDK::Constants::SANDBOX_ENV,
secret_key => "_YOUR_SECRET_KEY_",
sanitize => 1);
you can change the timeout of the request.
use NpsSDK::Nps;
NpsSDK::Configuration::configure(environment => $NpsSDK::Constants::SANDBOX_ENV,
secret_key => "_YOUR_SECRET_KEY_",
timeout => 60);