Can't seem to figure out a way to update unit_amount for an existing price. The API appears to allow it (unlike deleting a price), but the SDK seems to lack the corresponding fields in the UpdatePrice struct.
Related to the above, can't seem to find out how to use UpdatePriceCurrencyOptions, best I achieved was invalid object error from stripe.
To Reproduce
Create a price and get the id.
Create an UpdatePrice instance and try to update unit_amount.
Call stripe::Price::update() and observe the results.
Expected behavior
For simple prices (single currency) I was expecting to see an unit_amount field in UpdatePrice and maybe for more complex prices a HashMap field with String key indicating the currency and an UpdatePriceCurrencyOptions value indicating the specific currency-based pricing details. At least this is how the API seems to expose that functionality.
TBH the implementation of UpdatePriceCurrencyOptions looks incomplete to me, as the documentation mentions currency code key, which suggests a HashMap or whatever, but UpdatePrice accepts only Option<UpdatePriceCurrencyOptions>, not Option<HashMap<String, UpdatePriceCurrencyOptions>>.
It could be just me not understanding how to use the SDK, but figured I might as well ask what's going on...
Describe the bug
Can't seem to figure out a way to update
unit_amount
for an existing price. The API appears to allow it (unlike deleting a price), but the SDK seems to lack the corresponding fields in theUpdatePrice
struct.Related to the above, can't seem to find out how to use
UpdatePriceCurrencyOptions
, best I achieved was invalid object error from stripe.To Reproduce
UpdatePrice
instance and try to updateunit_amount
.stripe::Price::update()
and observe the results.Expected behavior
For simple prices (single currency) I was expecting to see an
unit_amount
field inUpdatePrice
and maybe for more complex prices a HashMap field with String key indicating the currency and anUpdatePriceCurrencyOptions
value indicating the specific currency-based pricing details. At least this is how the API seems to expose that functionality.TBH the implementation of
UpdatePriceCurrencyOptions
looks incomplete to me, as the documentation mentions currency code key, which suggests a HashMap or whatever, butUpdatePrice
accepts onlyOption<UpdatePriceCurrencyOptions>
, notOption<HashMap<String, UpdatePriceCurrencyOptions>>
.It could be just me not understanding how to use the SDK, but figured I might as well ask what's going on...
Code snippets