Class: ForestLiana::StripeController
Instance Method Summary
collapse
#authenticate_user_from_jwt, #serialize_model, #serialize_models
Instance Method Details
#cards ⇒ Object
27
28
29
30
31
32
33
34
35
36
37
|
# File 'app/controllers/forest_liana/stripe_controller.rb', line 27
def cards
getter = StripeCardsGetter.new(params,
request.['Stripe-Secret-Key'],
request.['Stripe-Reference'])
getter.perform
render json: serialize_models(getter.records, {
count: getter.count,
include: ['customer']
})
end
|
#invoices ⇒ Object
39
40
41
42
43
44
45
46
47
48
49
|
# File 'app/controllers/forest_liana/stripe_controller.rb', line 39
def invoices
getter = StripeInvoicesGetter.new(params,
request.['Stripe-Secret-Key'],
request.['Stripe-Reference'])
getter.perform
render json: serialize_models(getter.records, {
count: getter.count,
include: ['customer']
})
end
|
#payments ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
|
# File 'app/controllers/forest_liana/stripe_controller.rb', line 4
def payments
getter = StripePaymentsGetter.new(params,
request.['Stripe-Secret-Key'],
request.['Stripe-Reference'])
getter.perform
render json: serialize_models(getter.records, {
count: getter.count,
include: ['customer']
})
end
|
#refund ⇒ Object
16
17
18
19
20
21
22
23
24
25
|
# File 'app/controllers/forest_liana/stripe_controller.rb', line 16
def refund
begin
refunder = StripePaymentRefunder.new(params)
refunder.perform
render json: {}
rescue Stripe::InvalidRequestError => err
render json: { error: err.message }, status: 400
end
end
|