Created
May 28, 2020 15:19
-
-
Save fedeagripa/d49a024299d2b8e315ff0861d32e9534 to your computer and use it in GitHub Desktop.
create subscription
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/services/stripe_service.rb | |
def create_subscription | |
Stripe::Subscription.create( | |
customer: customer.id, | |
plan: subs_plan_id, # this is the id of your plan (eg: monthly, annual, etc) | |
coupon: discount_code # if you have any (check COUPONS section below to understand them in more detail) | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment