Skip to content

Commit

Permalink
Merge pull request #6 from starkbank/fix/charge-missing-fields
Browse files Browse the repository at this point in the history
added missing charge fields
  • Loading branch information
matheuscferraz authored Mar 12, 2020
2 parents 9d6adeb + 7c3f394 commit b11a87b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/charge/helpers.ex
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ defmodule StarkBank.Charge.Helpers do
amount: charge_map["amount"],
id: charge_map["id"],
status: charge_map["status"],
issue_date: MainHelpers.string_to_datetime(charge_map["issueDate"]),
workspace_id: charge_map["workspaceId"],
bar_code: charge_map["barCode"],
line: charge_map["line"],
due_date: MainHelpers.string_to_datetime(charge_map["dueDate"]),
Expand Down
2 changes: 2 additions & 0 deletions lib/charge/structs/charge.ex
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ defmodule StarkBank.Charge.Structs.ChargeData do
- discount_date [date or string ("%Y-%m-%d")]: defines limit date until when the defined discount will be valid (if discount is defined, discountDate must also be defined)
- status [string]: charge status, e.g.: created, registered, paid, overdue, canceled, failed;
- tags [list of strings]: custom tags used when searching charges, e.g.: ["client1", "cash-in"];
- workspace_id [strings]: workspace_id that created the charge, e.g.: "5078376503050240";
- descriptions [list of StarkBank.Charge.Structs.ChargeDescriptionData]: list of charge descriptions;
"""
defstruct [
Expand All @@ -33,6 +34,7 @@ defmodule StarkBank.Charge.Structs.ChargeData do
discount: nil,
discount_date: nil,
status: nil,
workspace_id: nil,
tags: [],
descriptions: []
]
Expand Down

0 comments on commit b11a87b

Please sign in to comment.