PayModel.fromJson constructor

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

Implementation

PayModel.fromJson(Map<String, dynamic> json) {
  if (json['type'] == null) {
    id = json['id'];
    status = json['status'];
    amount = json['amount'];
    fee = json['fee'];
    currency = json['currency'];
    refunded = json['refunded'];
    refundedAt = json['refundedAt'];
    captured = json['captured'];
    capturedAt = json['capturedAt'];
    voidedAt = json['voidedAt'];
    description = json['description'] ?? '';
    invoiceId = json['invoiceId'];
    ip = json['ip'];
    callbackUrl = json['callbackUrl'] ?? '';
    createdAt = json['createdAt'] ?? '';
    updatedAt = json['updatedAt'] ?? '';
    metadata = json['metadata'] ?? '';
    source = json['source'];
  } else {
    type = json['type'];
    message = json['message'] ?? '';
    error = json['error'] ?? '';
  }
}