Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Latest commit

 

History

History

2020-04-13-coupons-and-subscriptions

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Applying Coupons to Subscriptions - Office Hours 2020-04-10

Walk through the basics of applying coupons to Subscriptions using Ruby and Sinatra

🎬 Watch on YouTube

Requirements

How to run

  1. Install dependencies in the /server/ folder
bundle install --path vendor/bundle
  1. Configure your keys

Update the example .env file with your Stripe API keys.

  1. Create a recurring Plan and a Coupon (in test mode)

Enter the Plan ID and Coupon name and ID in server.rb file

plan_id = "plan_123"

COUPON_MAP = {
  name_of_coupon: "id_of_coupon",
}
  1. Run the application
ruby server.rb
  1. Go to localhost:4242 in your browser to see the demo

Demo

More Resources