init static method

LokotroPay init(
  1. LokotroPayConfig config
)

Initialise the SDK. Must be called exactly once, before mounting any LokotroPayCheckout widget.

Throws StateError if called more than once. To swap configuration during tests, use debugReset (debug builds only).

Implementation

static LokotroPay init(LokotroPayConfig config) {
  if (_instance != null) {
    throw StateError(
      'LokotroPay.init() has already been called. '
      'The SDK configuration is locked for the process lifetime. '
      'Use LokotroPay.debugReset() in tests.',
    );
  }
  _instance = LokotroPay._(config);
  return _instance!;
}