mSitefMenu method

Future<TefTransactionResponseMSitef?> mSitefMenu({
  1. required String ipSitef,
  2. required String storeId,
  3. required String terminalId,
  4. required String companyDocument,
  5. required String comExternal,
  6. required String isDoubleValidation,
  7. required String otp,
  8. required String enabledTransactions,
  9. required String automationDocument,
})

Implementation

Future<TefTransactionResponseMSitef?> mSitefMenu({
  required String ipSitef,
  required String storeId,
  required String terminalId,
  required String companyDocument,
  required String comExternal,
  required String isDoubleValidation,
  required String otp,
  required String enabledTransactions,
  required String automationDocument,
}) async {
  try {
    Map<String, dynamic> lineToMethodChannel({
      String? ipSitef,
      String? storeId,
      String? terminalId,
      String? companyDocument,
      String? comExternal,
      String? isDoubleValidation,
      String? otp,
      String? enabledTransactions,
      String? automationDocument,
    }) {
      return {
        'ipSitef': ipSitef,
        'storeId': storeId,
        'terminalId': terminalId,
        'companyDocument': companyDocument,
        'comExternal': comExternal,
        'isDoubleValidation': isDoubleValidation,
        'otp': otp,
        'enabledTransactions': enabledTransactions,
        'automationDocument': automationDocument,
      };
    }

    final paramsTransaction = lineToMethodChannel(
      ipSitef: ipSitef,
      storeId: storeId,
      terminalId: terminalId,
      companyDocument: companyDocument,
      comExternal: comExternal,
      isDoubleValidation: isDoubleValidation,
      otp: otp,
      enabledTransactions: enabledTransactions,
      automationDocument: automationDocument,
    );

    final resultTransaction = await channel.invokeMethod(
      'menuMSitef',
      paramsTransaction,
    );

    final resultJson = json.decode(resultTransaction);

    final model = TefTransactionModel.fromMap(resultJson);

    return _fetchTefTransactionResponse(
      model: model,
    );
  } catch (e) {
    return null;
  }
}