Sha256: 646f8cb8617dd6bedd94fd45ae8e634aed11ff3cd6b5d1a0e2a11b0b59d79d72

Contents?: true

Size: 805 Bytes

Versions: 42

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(
          payment: '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

42 entries across 42 versions & 1 rubygems

Version Path
effective_orders-4.3.2 app/controllers/effective/providers/free.rb
effective_orders-4.3.1 app/controllers/effective/providers/free.rb
effective_orders-4.3.0 app/controllers/effective/providers/free.rb
effective_orders-4.2.7 app/controllers/effective/providers/free.rb
effective_orders-4.2.6 app/controllers/effective/providers/free.rb
effective_orders-4.2.5 app/controllers/effective/providers/free.rb
effective_orders-4.2.4 app/controllers/effective/providers/free.rb
effective_orders-4.2.3 app/controllers/effective/providers/free.rb
effective_orders-4.2.2 app/controllers/effective/providers/free.rb
effective_orders-4.2.1 app/controllers/effective/providers/free.rb
effective_orders-4.2.0 app/controllers/effective/providers/free.rb
effective_orders-4.1.5 app/controllers/effective/providers/free.rb
effective_orders-4.1.4 app/controllers/effective/providers/free.rb
effective_orders-4.1.3 app/controllers/effective/providers/free.rb
effective_orders-4.1.2 app/controllers/effective/providers/free.rb
effective_orders-4.1.1 app/controllers/effective/providers/free.rb
effective_orders-4.1.0 app/controllers/effective/providers/free.rb
effective_orders-4.0.6 app/controllers/effective/providers/free.rb
effective_orders-4.0.5 app/controllers/effective/providers/free.rb
effective_orders-4.0.4 app/controllers/effective/providers/free.rb