Skip to content
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

Bug StripeInvoiceItemCreateOptions #1254

Closed
Klynk opened this issue Aug 22, 2018 · 3 comments · Fixed by #1255
Closed

Bug StripeInvoiceItemCreateOptions #1254

Klynk opened this issue Aug 22, 2018 · 3 comments · Fixed by #1255

Comments

@Klynk
Copy link

Klynk commented Aug 22, 2018

Hello,

I am having trouble with the library, due to what seems to be a bug.

https://stripe.com/docs/api#create_invoiceitem

Here you see 'Amount' is an optional property.

But for your source file, it is not:

https://github.com/stripe/stripe-dotnet/blob/master/src/Stripe.net/Services/InvoiceItems/StripeInvoiceItemCreateOptions.cs

[JsonProperty("amount")] public int Amount { get; set; }

It should be changed to:

[JsonProperty("amount")] public int? Amount { get; set; }

I am having trouble setting UnitAmount because of this, as it throws this exception:
Stripe.StripeException: 'You may only specify one of these parameters: amount, unit_amount.'

OS: Windows 10 (17134.228)
.NET Version: Microsoft.AspNetCore.All (v2.1.2)
Library Version: Stripe.net (v17.10.0)

@ob-stripe
Copy link
Contributor

Hi @Klynk, thanks a lot for the detailed report! I think your analysis is spot on. We'll release a fix promptly.

@ob-stripe
Copy link
Contributor

Fixed in 17.11.0.

@Klynk
Copy link
Author

Klynk commented Aug 23, 2018

Thank you, it works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants