1
0
mirror of synced 2026-09-12 08:55:02 +00:00
Files
discourse-subscriptions/app/controllers/products_controller.rb
T
2019-10-25 08:18:16 +11:00

22 lines
484 B
Ruby

# frozen_string_literal: true
module DiscoursePatrons
class ProductsController < ::ApplicationController
include DiscoursePatrons::Stripe
before_action :set_api_key
def index
begin
products = ::Stripe::Product.list(active: true)
# TODO: Serialize. Remove some attributes like metadata
render_json_dump products.data
rescue ::Stripe::InvalidRequestError => e
return render_json_error e.message
end
end
end
end