Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
create subscription
# 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
You can’t perform that action at this time.