2019-09-23 03:53:05 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DiscoursePatrons
|
2019-10-09 22:09:24 -04:00
|
|
|
module Admin
|
|
|
|
class SubscriptionsController < ::Admin::AdminController
|
|
|
|
include DiscoursePatrons::Stripe
|
2019-09-24 02:04:42 -04:00
|
|
|
|
2019-10-09 22:09:24 -04:00
|
|
|
before_action :set_api_key
|
2019-09-24 02:04:42 -04:00
|
|
|
|
2019-10-09 22:09:24 -04:00
|
|
|
def index
|
2019-10-16 06:06:19 -04:00
|
|
|
begin
|
|
|
|
subscriptions = ::Stripe::Subscription.list
|
|
|
|
|
|
|
|
render_json_dump subscriptions
|
|
|
|
rescue ::Stripe::InvalidRequestError => e
|
|
|
|
return render_json_error e.message
|
|
|
|
end
|
2019-10-09 22:09:24 -04:00
|
|
|
end
|
2019-09-23 03:53:05 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|