ESewaConfiguration constructor

ESewaConfiguration({
  1. required String clientID,
  2. required String secretKey,
  3. required String environment,
})

ESewaConfiguration constructor takes 3 requireds arguments

clientID : Client ID of the client/merchant

secretKey : Secret key of the client/merchant

environment : Environment integrating for i.e. LIVE (prod) or DEVELOPMENT (test).

Implementation

// Constructor
ESewaConfiguration(
    {required String clientID,
    required String secretKey,
    required String environment}) {
  if (environment == ENVIRONMENT_LIVE || environment == ENVIRONMENT_TEST) {
    this._clientID = clientID;
    this._secretKey = secretKey;
    this._env = environment;
  } else {
    throw Exception('''
      Environment of EsewaConfiguration must set to value either ENVIRONMENT_TEST or ENVIRONMENT_LIVE
    ''');
  }
}