tansengming / stripe-rails

A Rails Engine for integrating with Stripe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do not create a new product for each plan

renchap opened this issue · comments

After #101, the plan builder now always specifies a product.name in the POST request, thus creating a new product for each plan, even if the product name is the same.

The API docs state that you can either pass a hash to in product, or an existing product ID as a string.

It would be great to either be possible to pass a product_id attribute to the builder. A builder for products would also be great, to not have to create them manually.

Also, new attributes has been added to plans, most notably nickname, a customer-hidden name for the plan (displayed in the GUI for example).

Hi @renchap thanks for the heads up! I probably should have thought more deeply about the changes on #101 . I'll be busy with work for a bit so this fix will not come as soon I'd like.

Hi @renchap I've added a an option to pass product_id over here #115

Please have a look and let me know if it's working for you.

I'll probably do another PR for creating products which I should get out pretty soon.

Also, new attributes has been added to plans, most notably nickname, a customer-hidden name for the plan (displayed in the GUI for example).

I've release this on v1.4.2. Enjoy!