start method

  1. @override
Future<Map<Object?, Object?>?> start(
  1. String documentId,
  2. String identifier,
  3. String tokenId,
  4. HashMap<String, String>? additionalData,
  5. DigioConfig digioConfig,
  6. GatewayEventListenerImpl callback,
)
override

Implementation

@override
Future<Map<Object?, Object?>?> start(
    String documentId,
    String identifier,
    String tokenId,
    HashMap<String, String>? additionalData,
    DigioConfig digioConfig,
    GatewayEventListenerImpl callback) async {
  methodChannel.setMethodCallHandler((call) async {
    if (call.method == "gatewayEvent") {
      if (call.arguments != null) {
        callback(call.arguments);
      }
    }
  });
  final result =
      await methodChannel.invokeMethod<Map<Object?, Object?>>('start', {
    "documentId": documentId,
    "identifier": identifier,
    "tokenId": tokenId,
    "additionalData": additionalData,
    "environment": digioConfig.environment == Environment.SANDBOX
        ? "sandbox"
        : "production",
    "primaryColor": digioConfig.theme.primaryColor,
    "secondaryColor": digioConfig.theme.secondaryColor,
    "logo": digioConfig.logo,
  });
  return result;
}