OrderLineItemAdjustment.fromJson constructor

OrderLineItemAdjustment.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory OrderLineItemAdjustment.fromJson(Map<String, Object?> json) {
  if (json.keys.any((key) => key != "label" && key != "description")) {
    throw const FormatException("Invalid refund order line item adjustment");
  }
  return OrderLineItemAdjustment(
    label: json["label"] as String?,
    description: json["description"] as String?,
  );
}