Class Initialization

anchor image
Copied !

Class Initialisation for StandardCheckoutClient

StandardCheckoutClient class will be used to communicate with the PhonePe APIs. Merchant can create the instance only once per runtime; hence use the correct credentials while initializing the object.

Parameters :

Parameter NameData TypeMandatoryDescription
clientIdIntegerYesClient ID for secure communication with PhonePe.
clientVersionStringYesClient version for secure communication with PhonePe.
clientSecretStringYesSecret provided by PhonePe. To be kept secure on the merchant side.
envEnvYesEnvironment for the StandardCheckoutClient:

Env.PRODUCTION (Production)
Env.SANDBOX (Testing)

Throws PhonePeException:

If another StandardCheckoutClient object is initialized, PhonePeException is thrown.

Example usage:

import com.phonepe.sdk.pg.Env; import com.phonepe.sdk.pg.payments.v2.StandardCheckoutClient; String clientId = "<clientId>"; String clientSecret = "<clientSecret>"; Integer clientVersion = 1; //insert your client version here Env env = Env.SANDBOX; //Change to Env.PRODUCTION when you go live StandardCheckoutClient client = StandardCheckoutClient.getInstance(clientId, clientSecret, clientVersion, env);