init method

Future<bool> init (
  1. {@required String key,
  2. Environment environment: Environment.SANDBOX}
)

Initialize Checkout.com payment SDK. key public sdk key. environment the environment of initialization { SANDBOX, LIVE }, default SANDBOX.

Implementation

static Future<bool> init(
    {@required String key,
    Environment environment = Environment.SANDBOX}) async {
  try {
    return await _channel.invokeMethod(METHOD_INIT,
        <String, String>{'key': key, 'environment': environment.toString()});
  } on PlatformException catch (e) {
    if (e.code == INIT_ERROR)
      throw "Error Occured: Code: $INIT_ERROR. Message: ${e.message}. Details: SDK Initializtion Error";
    throw "Error Occured: Code: ${e.code}. Message: ${e.message}. Details: ${e.details}";
  }
}