SumupCheckoutResponse.fromMap constructor
SumupCheckoutResponse.fromMap(
- Map<String, dynamic> response
)
Implementation
factory SumupCheckoutResponse.fromMap(Map<String, dynamic> response) {
return SumupCheckoutResponse(
success: response['success'] as bool,
transactionCode: response['transactionCode'] as String?,
amount: (response['amount'] as num?)?.toDouble(),
currency: response['currency'] as String?,
vatAmount: (response['vatAmount'] as num?)?.toDouble(),
tipAmount: (response['tipAmount'] as num?)?.toDouble(),
paymentType: response['paymentType'] as String?,
entryMode: response['entryMode'] as String?,
installments: int.tryParse(response['installments'].toString()),
cardType: response['cardType'] as String?,
cardLastDigits: response['cardLastDigits'] as String?,
);
}