Files
discourse-subscriptions/app/controllers/plans_controller.rb
T

21 lines
394 B
Ruby
Raw Normal View History

2019-10-10 13:52:55 +11:00
# frozen_string_literal: true
module DiscoursePatrons
class PlansController < ::ApplicationController
include DiscoursePatrons::Stripe
before_action :set_api_key
def index
2019-10-17 12:07:06 +11:00
begin
plans = ::Stripe::Plan.list
render_json_dump plans.data
rescue ::Stripe::InvalidRequestError => e
return render_json_error e.message
end
2019-10-10 13:52:55 +11:00
end
end
end