RequestResponse.fromJson constructor
RequestResponse.fromJson(
- Map<String, dynamic> json
)
Implementation
factory RequestResponse.fromJson(Map<String, dynamic> json) =>
RequestResponse(
fullName: json["full_name"],
email: json["email"],
amount: json["amount"],
fee: json["fee"],
chargedAmount: json["charged_amount"],
invoiceId: json["invoice_id"],
paymentMethod: json["payment_method"],
senderNumber: json["sender_number"],
transactionId: json["transaction_id"],
date: json["date"] == null ? null : DateTime.parse(json["date"]),
status: json["status"] == 'COMPLETED'
? ResponseStatus.completed
: json['status'] == '' || json['status'] == null
? ResponseStatus.pending
: ResponseStatus.canceled,
);