mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-02-06 19:58:09 +00:00
21 lines
412 B
Ruby
21 lines
412 B
Ruby
# frozen_string_literal: true
|
|
|
|
module DiscoursePatrons
|
|
class SubscriptionsController < ::ApplicationController
|
|
include DiscoursePatrons::Stripe
|
|
|
|
before_action :set_api_key
|
|
|
|
def create
|
|
subscription = ::Stripe::Subscription.create(
|
|
customer: params[:customer],
|
|
items: [
|
|
{ plan: params[:plan] },
|
|
]
|
|
)
|
|
|
|
render_json_dump subscription
|
|
end
|
|
end
|
|
end
|