Sha256: 986c0a3403a4f2d3456e78fe59cb32c381db582b84b4fb2c6d4156fc9dde1542

Contents?: true

Size: 1.5 KB

Versions: 19

Compression:

Stored size: 1.5 KB

Contents

module ForestLiana
  class StripeController < ForestLiana::ApplicationController

    def payments
      getter = StripePaymentsGetter.new(params,
                                        request.headers['Stripe-Secret-Key'],
                                        request.headers['Stripe-Reference'])
      getter.perform

      render serializer: nil, json: serialize_models(getter.records, {
        count: getter.count,
        include: ['customer']
      })
    end

    def refund
      begin
        refunder = StripePaymentRefunder.new(params)
        refunder.perform

        render serializer: nil, json: {}
      rescue Stripe::InvalidRequestError => err
        render serializer: nil, json: { error: err.message }, status: 400
      end
    end

    def cards
      getter = StripeCardsGetter.new(params,
                                     request.headers['Stripe-Secret-Key'],
                                     request.headers['Stripe-Reference'])
      getter.perform

      render serializer: nil, json: serialize_models(getter.records, {
        count: getter.count,
        include: ['customer']
      })
    end

    def invoices
      getter = StripeInvoicesGetter.new(params,
                                        request.headers['Stripe-Secret-Key'],
                                        request.headers['Stripe-Reference'])
      getter.perform

      render serializer: nil, json: serialize_models(getter.records, {
        count: getter.count,
        include: ['customer']
      })
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
forest_liana-1.3.28 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.27 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.26 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.25 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.24 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.23 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.22 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.21 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.20 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.19 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.18 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.17 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.16 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.15 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.14 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.13 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.12 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.11 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.10 app/controllers/forest_liana/stripe_controller.rb