CardRegister.fromJson constructor

CardRegister.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CardRegister.fromJson(Map<String, dynamic> json) {
  final transactionReference = json['transaction_reference'] == null
      ? null
      : json['transaction_reference'] as String;

  final message = json['message'] == null ? null : json['message'] as String;

  final holderName =
      json['holder_name'] == null ? '' : json['holder_name'] as String;

  return CardRegister(
    bin: json['bin'] as String,
    status: json['status'] as String,
    token: json['token'] as String,
    holderName: holderName,
    expiryYear: json['expiry_year'] as String,
    expiryMonth: json['expiry_month'] as String,
    transactionReference: transactionReference,
    type: json['type'] as String,
    number: json['number'] as String,
    message: message,
  );
}