initialize static method

void initialize({
  1. Environment environment = Environment.production,
  2. bool enableLogging = true,
  3. bool saveLogToLocal = false,
})

Initializes the Airwallex SDK. Call this once at app startup before invoking any other payment method.

@param environment - The Airwallex environment to connect to. Defaults to Environment.production. @param enableLogging - When true, the SDK emits logs to the console. Android only. Defaults to true. @param saveLogToLocal - When true, logs are also persisted to a local file for debugging. Defaults to false.

Implementation

static void initialize(
    {Environment environment = Environment.production,
    bool enableLogging = true,
    bool saveLogToLocal = false}) {
  if (enableLogging && kDebugMode) {
    debugPrint(
        '[AirwallexSdk] Current connected environment: ${environment.name}');
  }
  AirwallexPaymentFlutterPlatform.instance
      .initialize(environment, enableLogging, saveLogToLocal);
}