1
0
mirror of synced 2026-08-05 06:36:55 +00:00

product controller

This commit is contained in:
Rimian Perkins
2019-10-25 08:18:16 +11:00
parent 5f71def8a4
commit 6fbcea2cf3
8 changed files with 55 additions and 3 deletions
+1
View File
@@ -10,6 +10,7 @@ module DiscoursePatrons
begin
plans = ::Stripe::Plan.list(active: true)
# TODO: Serialize. Remove some attributes like meta.group_name
render_json_dump plans.data
rescue ::Stripe::InvalidRequestError => e
+21
View File
@@ -0,0 +1,21 @@
# 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