Sha256: a34f24e307b967d44e78e24c1eab5d168e54b6dd7eeedb4be6470e0c54bebcfc

Contents?: true

Size: 1.42 KB

Versions: 27

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

27 entries across 27 versions & 1 rubygems

Version Path
forest_liana-1.3.9 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.8 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.7 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.6 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.5 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.4 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.3 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.2 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.1 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.3.0 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.2.6 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.2.5 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.2.3 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.2.2 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.2.1 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.35 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.34 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.33 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.32 app/controllers/forest_liana/stripe_controller.rb
forest_liana-1.1.31 app/controllers/forest_liana/stripe_controller.rb