6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'app/controllers/effective/providers/refund.rb', line 6
def refund
raise('refund provider is not available') unless EffectiveOrders.refund?
@order ||= Order.find(params[:id])
EffectiveResources.authorize!(self, :update, @order)
unless @order.refund?
flash[:danger] = 'Unable to process refund order with a positive total'
redirect_to effective_orders.order_path(@order)
return
end
flash[:success] = EffectiveOrders.refund[:success].presence
order_purchased(
payment: 'refund. no payment required.',
provider: 'refund',
purchased_url: refund_params[:purchased_url]
)
end
|