6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/effective/providers/moneris_checkout.rb', line 6
def moneris_checkout
raise('moneris_checkout provider is not available') unless EffectiveOrders.moneris_checkout?
@order = Order.find(params[:id])
(EffectiveResources.authorize!(self, :update, @order) rescue false)
payment = moneris_checkout_receipt_request(moneris_checkout_params[:ticket])
purchased = (1..49).include?(payment['response_code'].to_i)
if purchased == false
return order_declined(
payment: payment,
provider: 'moneris_checkout',
declined_url: moneris_checkout_params[:declined_url]
)
end
order_purchased(
payment: payment,
provider: 'moneris_checkout',
card: payment['card_type'],
purchased_url: moneris_checkout_params[:purchased_url]
)
end
|