initFraudSDK method

  1. @override
Future<String?> initFraudSDK(
  1. String transactionAPIKey,
  2. Environment env
)
override

Initializes the IronchipLbfraud SDK with the provided transactionAPIKey and env.

  • transactionAPIKey: The API key used for initialization.
  • env: The environment (e.g., production, testing, or development) for the SDK.

Returns a String indicating the result of the initialization process.

Implementation

@override
Future<String?> initFraudSDK(
    String transactionAPIKey, Environment env) async {
  String environment = "";
  switch (env) {
    case Environment.production:
      environment = "prod";
      break;
    case Environment.testing:
      environment = "testing";
      break;
    case Environment.develoment:
      environment = "dev";
      break;
  }

  try {
    String value = await methodChannel.invokeMethod('init-fraud',
        {"transactionAPIKey": transactionAPIKey, "environment": environment});
    return Future.value(value);
  } catch (e) {
    return Future.error(e);
  }
}