-
Notifications
You must be signed in to change notification settings - Fork 354
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
Make subscription_data keys for Checkout optional #593
Make subscription_data keys for Checkout optional #593
Conversation
It is possible to use the Stripe API without providing these keys. They are optional so we flag them as such to keep dialyzer happy. The Stripe docs indicate that only 'items' is required: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data
I'm not sure the best way to go about testing this. I'm very happy to try to add them if they are needed and if I could get some guidance? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!! One comment if you would like to add the additional keys
:trial_period_days => integer() | ||
optional(:metadata) => Stripe.Types.metadata(), | ||
optional(:trial_end) => integer(), | ||
optional(:trial_period_days) => integer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like we have 3 new keys if you felt like adding! I'll merge in a few days if you haven't.
application_fee_percent
coupon
default_tax_rates
trail_from_plan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can look at doing that, sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the new fields. I don't now if that is all that is necessary? I guess the system just handles the new information without having to add additional code?
The types are based on: https://github.com/stripe/stripe-go/blob/b363a1c3d64708d837a96d32a498b59d6287ab7b/checkout_session.go#L98-L107 https://github.com/stripe/stripe-java/blob/13055f22a885379c24dcba11feba0ec38b1bf018/src/main/java/com/stripe/param/checkout/SessionCreateParams.java#L2393 Application Free Percent would ideally be something that is limited to postive values with maximum two decimal places but it seems like other APIs don't require that.
It is possible to use the Stripe API without providing these keys. They
are optional so we flag them as such to keep dialyzer happy.
The Stripe docs indicate that only 'items' is required:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data
Closes #568