Class Initialization

SDK details

Class Initialization

StandardCheckoutClient class will be used to communicate with the PhonePe APIs. You can initiate the instance of this class only once.
Use required credentials while initializing the object.

Parameters

Parameter NameData TypeMandatoryDescription
clientIdStringYesClient ID for secure communication with PhonePe.
clientSecretStringYesSecret provided by PhonePe. To be kept secure on the merchant side.
clientVersionNumberYesClient version for secure communication with PhonePe.
envEnvYesEnvironment for the StandardCheckoutClient: 
‘PRODUCTION’ (production), 
‘SANDBOX’ (testing).


Throws PhonePeException

If another StandardCheckoutClient object is initialized, PhonePeException is thrown.

Example Usage :

import { StandardCheckoutClient, Env } from 'pg-sdk-node';
 
const clientId = "<clientId>";
const clientSecret = "<clientSecret>";
const clientVersion = 1;  //insert your client version here
const env = Env.SANDBOX;      //change to Env.PRODUCTION when you go live
 
const client = StandardCheckoutClient.getInstance(clientId, clientSecret, clientVersion, env);