arlyon / async-stripe

Async (and blocking!) Rust bindings for the Stripe API
https://payments.rs
Apache License 2.0
436 stars 127 forks source link

add extra documentation about the trail end #445

Open BentEngbers opened 11 months ago

BentEngbers commented 11 months ago

Is your feature request related to a problem? Please describe.

When creating a checkout session, the trial_end is limited by 730 days. Although the lower limit is documented (48 hours) the upper-limit is not. A quick search of the Stripe API did not show any documentation regarding this upper limit.

I get the following error from the api:

RequestError { 
http_status: 400, error_type: InvalidRequest, 
message: Some("The maximum number of trial period days is 730 (2 years).")

Describe the solution you'd like

There are two possible solutions.

  1. Add Documentation about this upper limit to the trail_end parameter in the checkout_session
  2. Include a small piece of code to make sure that the trail_end conforms to the upper and lower limit.

I am willing to help with these solutions.

Describe alternatives you've considered

No response

Additional context

No response

arlyon commented 10 months ago

We do not have a way of injecting the documentation at the moment. My suggestion would be to create an issue with stripes openapi repo to ask them to document this properly

https://github.com/stripe/openapi

That way all projects that depend on these can benefit from these changes.