wyyerd / stripe-rs

Rust API bindings for the Stripe HTTP API.
Apache License 2.0
223 stars 88 forks source link

Usage Records support #137

Closed phayes closed 3 years ago

phayes commented 4 years ago

Adds support for Usage Records as per https://stripe.com/docs/api/usage_records

arlyon commented 3 years ago

Hello, apologies for the late reply. We are working on getting up to speed on pull requests. May I ask if you are still interested in merging this (we are!) that you rebase? Thank you.

phayes commented 3 years ago

Hi @arlyon,

Yes I'll rebase my PRs. It might take a few days for me to get to it!

phayes commented 3 years ago

This is now rebased.

phayes commented 3 years ago

I've rebased again and added additional support for usage record summaries (https://stripe.com/docs/api/usage_records/subscription_item_summary_list)

One significant weird thing is the addition of the OpenPeriod type. According to the Stripe OpenAPI spec, period start and end dates are both nullable, however this nullability isn't used in most APIs. Nullable start and end dates ARE nullable in the Usage Record Summary API, so we need a new type to represent this.

phayes commented 3 years ago

Any update on getting this merged? AFAIK it should be good to go.

arlyon commented 3 years ago

Hey. I'm happy to merge once you run rustfmt–ci is complaining :)

phayes commented 3 years ago

I've run rustfmt, but I saw something puzzling. I'm going to do a little bit more testing here first. I'll post a note here when I'm confident it's good to go.

phayes commented 3 years ago

Hi @arlyon,

This should be good-to-go now. Thanks!

seanpianka commented 3 years ago

Thanks for the PR!