Map toJson()

Source

Map toJson() {
  Map result = {
    "id": id,
    "create_time": createTime?.toIso8601String(),
    "update_time": updateTime?.toIso8601String(),
    "state": state,
    "intent": intent,
    "experience_profile_id": experienceProfileId,
    "note_to_payer": noteToPayer,
    "failure_reason": failureReason,
    "payer": payer is Payer ? payer.toJson() : payer
  };

  if (transactions != null) {
    result["transactions"] =
        transactions.map((x) => x is Transaction ? x.toJson() : x).toList();
  }

  if (links != null) {
    result["links"] =
        links.map((x) => x is Link ? x.toJson() : x).toList();
  }

  return result;
}