Skip to content

Commit

Permalink
Add missing tax_info attributes to customer (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenvanvliet authored and snewcomer committed Aug 23, 2018
1 parent 185fa4e commit e294c8f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/stripe/core_resources/customer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ defmodule Stripe.Customer do
metadata: Stripe.Types.metadata(),
shipping: Stripe.Types.shipping() | nil,
sources: Stripe.List.t(Stripe.Source.t()),
subscriptions: Stripe.List.t(Stripe.Subscription.t())
subscriptions: Stripe.List.t(Stripe.Subscription.t()),
tax_info: Stripe.Types.tax_info() | nil,
tax_info_verification: Stripe.Types.tax_info_verification() | nil
}

defstruct [
Expand All @@ -52,7 +54,9 @@ defmodule Stripe.Customer do
:metadata,
:shipping,
:sources,
:subscriptions
:subscriptions,
:tax_info,
:tax_info_verification
]

@plural_endpoint "customers"
Expand All @@ -71,7 +75,8 @@ defmodule Stripe.Customer do
optional(:invoice_prefix) => String.t(),
optional(:metadata) => Stripe.Types.metadata(),
optional(:shipping) => Stripe.Types.shipping(),
optional(:source) => Stripe.Source.t()
optional(:source) => Stripe.Source.t(),
optional(:tax_info) => Stripe.Types.tax_info()
} | %{}
def create(params, opts \\ []) do
new_request(opts)
Expand Down Expand Up @@ -107,7 +112,8 @@ defmodule Stripe.Customer do
optional(:invoice_prefix) => String.t(),
optional(:metadata) => Stripe.Types.metadata(),
optional(:shipping) => Stripe.Types.shipping(),
optional(:source) => Stripe.Source.t()
optional(:source) => Stripe.Source.t(),
optional(:tax_info) => Stripe.Types.tax_info()
} | %{}
def update(id, params, opts \\ []) do
new_request(opts)
Expand Down
10 changes: 10 additions & 0 deletions lib/stripe/types.ex
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ defmodule Stripe.Types do
tracking_number: String.t() | nil
}

@type tax_info :: %{
type: String.t(),
tax_id: String.t() | nil,
}

@type tax_info_verification :: %{
status: String.t() | nil,
verified_name: String.t() | nil,
}

@type transfer_schedule :: %{
delay_days: non_neg_integer,
interval: String.t(),
Expand Down

0 comments on commit e294c8f

Please sign in to comment.