Sha256: fa79ecf4e4d60ccb6d6a0226f8bf64c662309b70be1f82d2a51d71ab397f4eb0

Contents?: true

Size: 1.42 KB

Versions: 24

Compression:

Stored size: 1.42 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 json: serialize_models(getter.records, {
        count: getter.count,
        include: ['customer']
      })
    end

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

        render json: {}
      rescue Stripe::InvalidRequestError => err
        render 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 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 json: serialize_models(getter.records, {
        count: getter.count,
        include: ['customer']
      })
    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
forest_liana-1.1.22 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.20 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.19 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.18 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.17 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.16 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.15 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.14 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.13 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.12 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.11 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.10 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.8 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.7 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.6 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.5 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.4 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.3 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.2 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.1 app/controllers/forest_liana/stripe_controller.rb