Sha256: cd8e0104a23193f122be596db868c10056fbe7b6a44d919e076d727e1d7dd2e5
Contents?: true
Size: 847 Bytes
Versions: 24
Compression:
Stored size: 847 Bytes
Contents
module Effective module Providers module Free extend ActiveSupport::Concern def free raise('free provider is not available') unless EffectiveOrders.free? @order ||= Order.find(params[:id]) EffectiveResources.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: free_params[:purchased_url], current_user: current_user ) end def free_params params.require(:free).permit(:purchased_url, :declined_url) end end end end
Version data entries
24 entries across 24 versions & 1 rubygems