RailsApps / rails-stripe-membership-saas

An example Rails 4.2 app with Stripe and the Payola gem for a membership or subscription site.
http://railsapps.github.io/rails-stripe-membership-saas
1.14k stars 232 forks source link

How to apply a discount code for a new subscriber ? #105

Closed ycourse closed 9 years ago

ycourse commented 10 years ago

Hello Guys,

I would like apply a discount code like this for a new subscriber

https://xxxxxx.com/signup?plan=xxxx?discount_code=xxx

Is this possible ? Thank you.

JamesDullaghan commented 10 years ago

There is already an attr_accessor for coupon. Set @user.coupon to params[:discount_code] in the controller and add it to the update_plan method in the model.