Skip to content

Commit

Permalink
Merge pull request #166 from code-corps/add-account-update
Browse files Browse the repository at this point in the history
Add Account.update/2
  • Loading branch information
joshsmith authored Dec 20, 2016
2 parents 539ea72 + 4813fe2 commit 5014a3c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lib/stripe/account.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ defmodule Stripe.Account do
defstruct [
:id, :business_name, :business_primary_color, :business_url,
:charges_enabled, :country, :default_currency, :details_submitted,
:display_name, :email, :managed, :metadata, :statement_descriptor,
:support_email, :support_phone, :support_url, :timezone,
:transfers_enabled
:display_name, :email, :external_accounts, :managed, :metadata,
:statement_descriptor, :support_email, :support_phone, :support_url,
:timezone, :transfers_enabled
]

@relationships %{}
Expand Down Expand Up @@ -59,4 +59,15 @@ defmodule Stripe.Account do
defp do_retrieve(endpoint, opts \\ []) do
Stripe.Request.retrieve(endpoint, __MODULE__, opts)
end

@doc """
Update an account.
Takes the `id` and a map of changes.
"""
@spec update(t, map, list) :: {:ok, t} | {:error, Stripe.api_error_struct}
def update(id, changes, opts \\ []) do
endpoint = @plural_endpoint <> "/" <> id
Stripe.Request.update(endpoint, changes, @valid_update_keys, __MODULE__, opts)
end
end

0 comments on commit 5014a3c

Please sign in to comment.