KoudokuCoupons adds support for Stripe coupons to Koudoku.
For KoudokuCoupons to work properly you need to add the following lines to your Gemfile
:
gem 'koudoku', git: 'https://github.com/andrewculver/koudoku.git' # handles stripe subscriptions
gem 'koudoku_coupons'
Next run bundle install
. After that you need to add the migrations to your application:
rails g koudoku_coupons:install
rake db:migrate
This will copy the migration into your application and run it. Additionally it will mount KoudokuCoupons at /promotions
If you are using Devise for authentication, you need to add this line
to your ApplicationController
to allow non-logged-in users to use coupons:
skip_filter :authenticate_user!, :if => :koudoku_coupons_controller?
First you need to create a new coupon in the Stripe dashboard.
To add a new promotion visit your application at /promotions/promotions/new
and enter the following data:
name
: a name for the promotion. A promotion with name "50percentoff" will be available at/promotions/50percentoff
coupon_code
: the coupon code that you selected in the Stripe Dashboardredirect
: The URL users will be redirected to after hitting the promotion URL - e.g. https://www.linksspy.com/email/landingpage?utm_source=github&utm_medium=web&utm_campaign=open_source