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

Make subscription_data keys for Checkout optional #593

Merged

Conversation

michaeljones
Copy link
Contributor

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

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
@michaeljones
Copy link
Contributor Author

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?

@coveralls
Copy link

coveralls commented Apr 23, 2020

Coverage Status

Coverage remained the same at 88.079% when pulling 20ce7d8 on michaeljones:subscription-data-types into e54dd47 on code-corps:master.

Copy link
Collaborator

@snewcomer snewcomer left a 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()
Copy link
Collaborator

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

Copy link
Contributor Author

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!

Copy link
Contributor Author

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?

@snewcomer snewcomer merged commit e47f748 into beam-community:master May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stripe.Session subscription_data required keys should be optional
3 participants