.NET Class Initialization


CustomCheckoutClient 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.

  • The CustomCheckoutClient class is used to interact with PhonePe APIs. Only one instance of this client should be created per runtime. Make sure to use the correct credentials when initializing to avoid exceptions.
Parameters
ParameterTypeMandatoryDescription
clientIdStringYesUnique Client ID provided by PhonePe.
clientSecretStringYesUnique Client Secret provided by PhonePe.
cientVersionIntegerYesUnique Client Version provided by PhonePe.
envEnvYesEnvironment for the CustomCheckoutClient: Env.PRODUCTION (production), Env.SANDBOX (testing).

Code Reference
import {CustomCheckoutClient, Env} from 'pg-sdk-node';
 
const clientId:string = "<clientId>";
const clientSecret:string = "<clientSecret>";
const clientVersion:string = "<clientVersion>"; //insert your client version here
const env:Env = Env.SANDBOX;      //change to Env.PRODUCTION when you go live
 
const client = CustomCheckoutClient.getInstance(clientId, clientSecret, clientVersion, env);
Is this article helpful?