SumupPluginCheckoutResponse.fromMap constructor

SumupPluginCheckoutResponse.fromMap(
  1. 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'];

  // some parameters are available only for Android
  if (Platform.isAndroid) {
    foreignTransactionId = response['foreignTransactionId'];
    receiptSent = response['receiptSent'];
  }
}