-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot set price unit_amount to 0 #42
Open
adamstegman opened this issue
Feb 1, 2021
· 2 comments
· Fixed by bchatelard/terraform-provider-stripe#3 · May be fixed by #49
Open
Cannot set price unit_amount to 0 #42
adamstegman opened this issue
Feb 1, 2021
· 2 comments
· Fixed by bchatelard/terraform-provider-stripe#3 · May be fixed by #49
Comments
I'm not familiar with terraform plugins, but looking at terraform-provider-stripe/vendor/github.com/hashicorp/terraform/helper/schema/resource_data.go Line 102 in 25ead04
GetOk incorrectly returns a non-existent value in this case. Maybe GetOkExists should be used instead, since it does not check the zero-value?
|
adamstegman
added a commit
to adamstegman/terraform-provider-stripe
that referenced
this issue
Jun 23, 2021
This allows for a `0` price to be set as a price `amount` in Stripe. `GetOk` considers `0` as a null value for integers, because it's unclear whether it was intentionally set or unset. `GetOkExists` allows us to get whatever value was set, even if it's `0`. Fixes franckverrot#42
adamstegman
added a commit
to adamstegman/terraform-provider-stripe
that referenced
this issue
Jul 20, 2021
This allows for a `0` price to be set as a price `amount` in Stripe. `GetOk` considers `0` as a null value for integers, because it's unclear whether it was intentionally set or unset. `GetOkExists` allows us to get whatever value was set, even if it's `0`. Fixes franckverrot#42
When this fix will be available? |
bchatelard
pushed a commit
to bchatelard/terraform-provider-stripe
that referenced
this issue
Apr 13, 2023
This allows for a `0` price to be set as a price `amount` in Stripe. `GetOk` considers `0` as a null value for integers, because it's unclear whether it was intentionally set or unset. `GetOkExists` allows us to get whatever value was set, even if it's `0`. Fixes franckverrot#42
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I try to create a price with a
unit_amount
of0
, orunit_amount_decimal
of0.0
, I get the following error:When I look at Stripe logs, the field is left out of the request entirely:
This is incorrect - an amount of 0 is valid and I can use the API directly to create the price.
The text was updated successfully, but these errors were encountered: