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

toJson fails to create exactly the same json as the Stripe HTTP API #1845

Open
decoursin opened this issue Aug 6, 2024 · 2 comments
Open

Comments

@decoursin
Copy link

Describe the bug

The InvoiceLineItem.getUnitAmountExcludingTax returns a BigDecimal. While the Stripe API HTTP Server returns the unit_amount_excluding_tax as a string.

As a result, when the InvoiceLineItem is serialized using toJson, it returns a completely different format than the Stripe API Http Server. They should be the same.

To Reproduce

  1. Create an invoice and 1 invoice item.
  2. Serialize that invoice using toJson.
  3. View the serialize invoice item, and see that it's serialized as a json number rather than a string.

Expected behavior

Serializing an InvoiceLineItem using toJson is suppose to replicate the Stripe API HTTP server 100% exactly, and it's not doing that.

Code snippets

No response

OS

All

Java version

Java 17

stripe-java version

v26.4.0

API version

2024-06-20

Additional context

No response

@decoursin decoursin added the bug label Aug 6, 2024
@xavdid-stripe
Copy link
Member

Thanks for filing! We've copied to our internal bug tracker and will address it when we have a chance.

@decoursin
Copy link
Author

Great, thank you

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

No branches or pull requests

3 participants