TokenResponse.fromMap constructor

TokenResponse.fromMap(
  1. Map map
)

Implementation

factory TokenResponse.fromMap(Map map) {
  return TokenResponse(
    card: CreditCard.fromJson(json.encode(map)),
    token: map['token'] ?? '',
    type: PaymentMethod.values
        .firstWhere((e) => e.name.toLowerCase() == map['type']),
  );
}