Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Amount for inputs should be represented as u64 #370

Closed
toksdotdev opened this issue Apr 28, 2023 · 2 comments
Closed

Amount for inputs should be represented as u64 #370

toksdotdev opened this issue Apr 28, 2023 · 2 comments
Labels
codegen wontfix This will not be worked on

Comments

@toksdotdev
Copy link

toksdotdev commented Apr 28, 2023

Describe the bug

Amount in inputs are currently represented as i64 in this crate, but based on the Stripe docs, amounts are always positive (for the ones I've noticed so far: payment intents and refunds).

To Reproduce

See the stripe docs for payment intents and refunds.

Expected behavior

Amounts should be represented as strictly u64 for payment intent & refund inputs (there might be other places were this also applies, but these are the two(2) I've noticed).

Code snippets

No response

OS

macos

Rust version

1.69

Library version

async-stripe 0.21.0

API version

2022-11-15

Additional context

No response

@toksdotdev toksdotdev added the bug Something isn't working label Apr 28, 2023
@arlyon
Copy link
Owner

arlyon commented Jun 20, 2023

Thanks for opening an issue (and sorry for the reply, I am only now clearing some of the backlog here).

This is a limitation of how stripe choose to expose their API, which is done using OpenAPI, and has no concept of strictly positive numbers or even of sized numbers, only 'integers'. OpenAPI does allow encoding ranges (minimum and maximum) but Stripe does not include that information.

If this is something that is important to you, I would consider opening an issue with stripe/openapi and ask if they can expose that. I am going to close this in the mean time.

Cheers!

@arlyon arlyon closed this as completed Jun 20, 2023
@arlyon arlyon added wontfix This will not be worked on codegen and removed bug Something isn't working labels Jun 20, 2023
@WesleyAC
Copy link

Upstream issue, for reference: stripe/openapi#36

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
codegen wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants