Introduction
Nuvei SDKs (Software Development Kits) are easy-to-use code libraries, which provide user-friendly wrappers for REST API.
- SDKs are provided for:
- All the parameter names are the same as the REST API parameters making it easy to reference the Nuvei Developers Portal for guidance.
Why Use Nuvei Server SDKs?
Nuvei SDKs have many advantages:
- Fast integration:
- Seamless integration of the SDK library into your development environment.
- Optimized code re-use to minimize integration time.
- Ease of use:
- Appropriate use of API communication protocols.
- Seamless error handling.
- Automatic checksum calculation for easier initialization.
- Documentation hints embedded in the code.
- Built-in unit testing:
- Contain pre-filled data for fast testing examples.
SDK Methods
/getSessionToken
/openOrder
/payment
/settleTransaction
/refundTransaction
/voidTransaction
/getPaymentStatus
/getCardDetails
/initPayment
/authorize3d
/verify3d
/accountCapture
/payout
For details of all the Nuvei Methods, parameters, example requests and responses, see the Nuvei API Reference Guide.
Prerequisites for Initialization
Before initializing the SDK, use the links provided in the following table to import the latest version of the relevant SDK into your code environment.
SDK | GitHub Link | External Libraries |
---|---|---|
PHP | PHP GitHub | --- |
Java | Java GitHub | Java Maven |
C# | .NET GitHub | .NET NuGet |
Nodes.JS | --- | Node.JS NPM |
Initialize the Nuvei SDK
Initializing the Nuvei SDK authenticates you as a merchant.
Include this script before sending any requests to the API server:
$safecharge = new SafeChargeApiRestClient([ 'environment' => SafeChargeApiEnvironment::INT, 'merchantId' => '<your merchantId>', 'merchantSiteId' => '<your merchantSiteId>', 'merchantSecretKey' => '<your merchantSecretKey>', ]);
public class Main { public static void main(String[] args) { String merchantId = "<your merchantId>"; String merchantSiteId = "<your merchantSiteId>"; String merchantKey = "<your merchantKey>"; safecharge.initialize(merchantId, merchantSiteId, merchantKey, Constants.HashAlgorithm.SHA256); } }
var safecharge = new Safecharge( "<your merchantKey>", "<your merchantId>", "<your merchantSiteId>", "<your server host value>", HashAlgorithmType.SHA256 );
const safecharge = require('safecharge'); safecharge.initiate(<merchantId>, <merchantSiteId>, <merchantSecretKey>, <env>);
Possible values for the environment
parameter:
- prod – (default) Nuvei live production environment.
- int – Nuvei sandbox environment.