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