Skip to content

Commit

Permalink
Fix Stripe.Price unit_amount_decimal and lookup_keys type (#668)
Browse files Browse the repository at this point in the history
* Fix spec for price lookup_keys type as list

https://stripe.com/docs/api/prices/list#list_prices-lookup_keys
eg. https://api.stripe.com/v1/prices?lookup_keys[0]=key0&lookup_keys[1]=key1

* Fix Stripe.Price struct unit_amount_decimal

instead of amount_decimal (Ref: https://stripe.com/docs/api/prices/retrieve)
  • Loading branch information
gkmlo authored May 17, 2021
1 parent 9726c4f commit aeff78b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/stripe/subscriptions/price.ex
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ defmodule Stripe.Price do
transform_quantity: transform_quantity(),
type: String.t(),
unit_amount: pos_integer,
amount_decimal: String.t()
unit_amount_decimal: String.t()
}

defstruct [
Expand All @@ -116,7 +116,7 @@ defmodule Stripe.Price do
:transform_quantity,
:type,
:unit_amount,
:amount_decimal
:unit_amount_decimal
]

@plural_endpoint "prices"
Expand Down Expand Up @@ -201,7 +201,7 @@ defmodule Stripe.Price do
optional(:created) => Stripe.timestamp(),
optional(:ending_before) => t | Stripe.id(),
optional(:limit) => 1..100,
optional(:lookup_keys) => String.t(),
optional(:lookup_keys) => list(String.t()),
optional(:recurring) => recurring() | nil,
optional(:starting_after) => t | Stripe.id()
}
Expand Down

0 comments on commit aeff78b

Please sign in to comment.