stripe-scala icon indicating copy to clipboard operation
stripe-scala copied to clipboard

Plans.create has incorrect parameters

Open stewSquared opened this issue 7 years ago • 6 comments

~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 avatar Mar 16 '18 02:03 stewSquared

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.

stewSquared avatar Mar 16 '18 03:03 stewSquared

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 avatar Mar 16 '18 09:03 leonardehrenfried

@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.

stewSquared avatar Mar 16 '18 10:03 stewSquared

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 .

leonardehrenfried avatar Mar 16 '18 11:03 leonardehrenfried

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

mdedetrich avatar Mar 17 '18 10:03 mdedetrich

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

stewSquared avatar Mar 19 '18 18:03 stewSquared