.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.
Request
- The
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.CustomCheckoutClient
Parameters
| Parameter | Type | Mandatory | Description |
clientId | String | Yes | Unique Client ID provided by PhonePe. |
clientSecret | String | Yes | Unique Client Secret provided by PhonePe. |
cientVersion | Integer | Yes | Unique Client Version provided by PhonePe. |
env | Env | Yes | Environment 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);