PaymentResponse.fromJson constructor

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

Implementation

PaymentResponse.fromJson(Map<String?, dynamic> json) {
  createdAt = json['createdAt'];
  id = json['id'];
  if (json['items'] != null) {
    items = new List<PaymentItem>.empty(growable: true);
    json['items'].forEach((item) {
      items!.add(new PaymentItem.fromJson(item));
    });
  }
  notes = json['notes'];
  number = json['number'];
  paidAmount = json['paidAmount'];
  if (json['payments'] != null) {
    payments = new List<Payment>.empty(growable: true);
    json['payments'].forEach((payment) {
      payments!.add(new Payment.fromJson(payment));
    });
  }
  pendingAmount = json['pendingAmount'];
  price = json['price'];
  reference = json['reference'];
  status = json['status'];
  type = json['type'];
  updatedAt = json['updatedAt'];
}