Sha256: 6f25127f6badd8b34a7dd232492b544b08dc41d0d82cdd5c29b5e092467b407a

Contents?: true

Size: 805 Bytes

Versions: 15

Compression:

Stored size: 805 Bytes

Contents

module Effective
  module Providers
    module Free
      extend ActiveSupport::Concern

      def free
        @order ||= Order.find(params[:id])

        EffectiveOrders.authorize!(self, :update, @order)

        unless @order.free?
          flash[:danger] = 'Unable to process free order with a non-zero total'
          redirect_to effective_orders.order_path(@order)
          return
        end

        order_purchased(
          details: 'free order. no payment required.',
          provider: 'free',
          card: 'none',
          purchased_url: params[:purchased_url],
          declined_url: params[:declined_url],
          email: false
        )
      end

      def free_params
        params.require(:effective_order).permit(:purchased_url, :declined_url)
      end

    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
effective_orders-3.2.3 app/controllers/effective/providers/free.rb
effective_orders-3.2.2 app/controllers/effective/providers/free.rb
effective_orders-3.2.1 app/controllers/effective/providers/free.rb
effective_orders-3.2.0 app/controllers/effective/providers/free.rb
effective_orders-3.1.7 app/controllers/effective/providers/free.rb
effective_orders-3.1.6 app/controllers/effective/providers/free.rb
effective_orders-3.1.4 app/controllers/effective/providers/free.rb
effective_orders-3.1.3 app/controllers/effective/providers/free.rb
effective_orders-3.1.0 app/controllers/effective/providers/free.rb
effective_orders-3.0.4 app/controllers/effective/providers/free.rb
effective_orders-3.0.3 app/controllers/effective/providers/free.rb
effective_orders-3.0.2 app/controllers/effective/providers/free.rb
effective_orders-4.0.0beta1 app/controllers/effective/providers/free.rb
effective_orders-3.0.1 app/controllers/effective/providers/free.rb
effective_orders-3.0.0 app/controllers/effective/providers/free.rb