Refund.fromJson constructor
Implementation
factory Refund.fromJson(Map<String, Object?> json) => Refund(
canceledAt: json["canceled_at"] == null
? null
: decodeDateTime(json["canceled_at"]),
createdAt: decodeDateTime(json["created_at"]),
customData: json["custom_data"] == null
? null
: core.CustomData.fromJson(json["custom_data"]),
failedAt: json["failed_at"] == null
? null
: decodeDateTime(json["failed_at"]),
id: json["id"] as String,
lineItems: (json["line_items"] as List)
.map(
(item) =>
LineItem.fromJson((item as Map).cast<String, Object?>()),
)
.toList(),
orderId: json["order_id"] as String,
processingAt: json["processing_at"] == null
? null
: decodeDateTime(json["processing_at"]),
reason: Reason.fromJson(json["reason"]),
reasonDetails: json["reason_details"] == null
? null
: json["reason_details"] as String,
reference:
json["reference"] == null ? null : json["reference"] as String,
settlement: Settlement.fromJson(json["settlement"]),
status: Status.fromJson(json["status"]),
succeededAt: json["succeeded_at"] == null
? null
: decodeDateTime(json["succeeded_at"]),
total: inttegro_money.Amount.fromJson(
(json["total"] as Map).cast<String, Object?>()),
);