Skip to content

Commit

Permalink
Add clause for DateTime conversion, add tos_acceptance key
Browse files Browse the repository at this point in the history
  • Loading branch information
begedin committed Jan 2, 2017
1 parent f1da506 commit dbdf507
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/stripe/account.ex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ defmodule Stripe.Account do
:charges_enabled, :country, :default_currency, :details_submitted,
:display_name, :email, :legal_entity, :external_accounts, :managed,
:metadata, :statement_descriptor, :support_email, :support_phone,
:support_url, :timezone, :transfers_enabled, :verification
:support_url, :timezone, :tos_acceptance, :transfers_enabled,
:verification
]

@relationships %{}
Expand Down Expand Up @@ -100,7 +101,7 @@ defmodule Stripe.Account do
phone_number: [:create, :retrieve, :update],
ssn_last_4: [:create, :update], # US only
ssn_last_4_provided: [:retrieve],
type: [:create, :update, :retrieve], # "individual" or "company"
type: [:create, :update, :retrieve], # "individual" or "company",
verification: %{
details: [:retrieve],
details_code: [:retrieve],
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/converter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ defmodule Stripe.Converter do
defp convert_key(key) when is_atom(key), do: to_string(key)
defp convert_key(key) when is_binary(key), do: String.to_atom(key)

defp convert_value(%DateTime{} = value), do: value
defp convert_value(value) when is_map(value) do
Enum.reduce(value, %{}, fn({key, value}, acc) ->
Map.put(acc, String.to_atom(key), convert_value(value))
Expand Down

0 comments on commit dbdf507

Please sign in to comment.