stripe-scala
stripe-scala copied to clipboard
Plans.create has incorrect parameters
~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.
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.
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.
@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.
I usually review within 1 or 2 days.
Matthew cuts the releases in the end and sometimes needs a little more prodding but it shouldn't be more than a few days.
Am 16.03.2018 11:23 schrieb "Stewart Stewart" [email protected]:
@leonardehrenfried https://github.com/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.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mdedetrich/stripe-scala/issues/40#issuecomment-373669908, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJPMiuE8YQldQ0cvKnS3erIUc_VwGr2ks5te5KqgaJpZM4StJ3M .
If you submit a PR I can easily review and merge.
@mdedetrich @leonardehrenfried Sounds great! I'll submit something later today.