SumupPluginCheckoutResponse.fromMap constructor
SumupPluginCheckoutResponse.fromMap(
- Map response
Implementation
SumupPluginCheckoutResponse.fromMap(Map<dynamic, dynamic> response) {
success = response['success'];
transactionCode = response['transactionCode'];
amount = response['amount'];
currency = response['currency'];
vatAmount = response['vatAmount'];
tipAmount = response['tipAmount'];
paymentType = response['paymentType'];
entryMode = response['entryMode'];
installments = int.tryParse(response['installments'].toString());
cardType = response['cardType'];
cardLastDigits = response['cardLastDigits'];
userDismissedSuccessScreen = response['userDismissedSuccessScreen'] as bool?;
errors = response['errors']?.toString();
merchantCode = response['merchantCode']?.toString();
cardScheme = response['cardScheme']?.toString();
final rawProducts = response['products'];
if (rawProducts is List) {
products = rawProducts
.whereType<Map>()
.map((e) => SumupProduct.fromMap(e))
.toList();
}
// some parameters are available only for Android
if (Platform.isAndroid) {
foreignTransactionId = response['foreignTransactionId'];
receiptSent = response['receiptSent'];
}
}