TransactionRequest constructor
TransactionRequest({
- required TransactionType transactionType,
- required int amountMinorUnits,
- required String currency,
- required String idempotencyKey,
- String? referenceId,
- String? description,
- List<
EntryMode> allowedEntryModes = const [EntryMode.chip, EntryMode.tap, EntryMode.swipe], - List<
EntryMode> preferredEntryModes = const [], - bool requestSignature = false,
- Duration? timeout,
- Map<
String, dynamic> ? metadata,
Implementation
TransactionRequest({
required this.transactionType,
required this.amountMinorUnits,
required this.currency,
required this.idempotencyKey,
this.referenceId,
this.description,
this.allowedEntryModes = const [
EntryMode.chip,
EntryMode.tap,
EntryMode.swipe,
],
this.preferredEntryModes = const [],
this.requestSignature = false,
this.timeout,
this.metadata,
}) {
if (amountMinorUnits < 0) {
throw ArgumentError.value(
amountMinorUnits,
'amountMinorUnits',
'must be >= 0',
);
}
if (currency.length != 3) {
throw ArgumentError.value(
currency,
'currency',
'must be a 3-letter ISO 4217 code',
);
}
if (idempotencyKey.isEmpty) {
throw ArgumentError.value(
idempotencyKey,
'idempotencyKey',
'must not be empty',
);
}
}