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

Plans.create has incorrect parameters #40

Open
stewSquared opened this issue Mar 16, 2018 · 6 comments · May be fixed by #41
Open

Plans.create has incorrect parameters #40

stewSquared opened this issue Mar 16, 2018 · 6 comments · May be fixed by #41

Comments

@stewSquared
Copy link

stewSquared commented Mar 16, 2018

I've noticed a few issues with the createPlan implementation:
A recent Major change in the Stripe API breaks the current Plans implementation:

(1) We're missing the product parameter. From https://stripe.com/docs/api/java#create_plan-product:

The product whose pricing the created plan will represent. This can either be the ID of an existing product, or a dictionary containing fields used to create a service product.

In this implementation, product is missing from both the Plan and PlanInput case classes.

(2) The name field is incorrectly encoded. I'm assuming the name parameter was supposed to be used as the plan's optional nickname as opposed to the product's required name. If that's so, the spelling of this field is another bug. In the other case, it's still a bug since it's not a required field nested under the (missing) product object.

(3) trial_period_days is not a parameter for creating plans, though it is present in the returned json. Rather, it's a paremeter when creating subscriptions to existing plans.

@stewSquared stewSquared changed the title Create Plan is missing a required parameter product Plans.create has incorrect parameters Mar 16, 2018
@stewSquared
Copy link
Author

I should note that the rest of the Plans API looks really good. Thanks a lot! This library is saving me a ton of trouble.

@leonardehrenfried
Copy link
Collaborator

Neither @mdedetrich or myself are actively adding features to this library but we would welcome pull requests with tests. There are already quite a few unit/integration tests around so just copy what you see there.

@stewSquared
Copy link
Author

@leonardehrenfried Sure thing! I don't think it's too much effort to provide fixes myself.
How actively are you two reviewing PRs and cutting releases? I've found a couple more subtle bugs since I posted the issue last night.

@leonardehrenfried
Copy link
Collaborator

leonardehrenfried commented Mar 16, 2018 via email

@mdedetrich
Copy link
Owner

If you submit a PR I can easily review and merge.

@stewSquared
Copy link
Author

@mdedetrich @leonardehrenfried
Sounds great! I'll submit something later today.

@stewSquared stewSquared linked a pull request Mar 20, 2018 that will close this issue
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 a pull request may close this issue.

3 participants