class Stall::Atos::Gateway
Public Class Methods
fake_payment_notification_for(cart)
click to toggle source
# File lib/stall/atos/gateway.rb, line 36 def self.fake_payment_notification_for(cart) Stall::Atos::FakeGatewayPaymentNotification.new(cart) end
request(cart)
click to toggle source
# File lib/stall/atos/gateway.rb, line 28 def self.request(cart) Request.new(cart) end
response(request)
click to toggle source
# File lib/stall/atos/gateway.rb, line 32 def self.response(request) Response.new(request) end
Public Instance Methods
synchronous_payment_notification?()
click to toggle source
The gateway interface only provides one return URL, so we use the payment notification state to determine wether to forward the customer to the next checkout step or not.
# File lib/stall/atos/gateway.rb, line 48 def synchronous_payment_notification? true end
target_url()
click to toggle source
# File lib/stall/atos/gateway.rb, line 40 def target_url test_mode ? test_payment_url : payment_url end
Private Instance Methods
next_transaction_id()
click to toggle source
Override the transaction id methods, since the Atos
gateway only authorize numbers
# File lib/stall/atos/gateway.rb, line 56 def next_transaction_id if (last_transaction = Payment.order("data->>'transaction_id' DESC").select(:data).first) if (id = last_transaction.transaction_id) index = id[-5..-1].to_i + 1 return transaction_id_for(index) end end transaction_id_for(1) end
transaction_id_for(index)
click to toggle source
Calls superclass method
# File lib/stall/atos/gateway.rb, line 67 def transaction_id_for(index) super.gsub(/-/, '') end
transaction_id_format()
click to toggle source
# File lib/stall/atos/gateway.rb, line 71 def transaction_id_format '%{cart_id}%{transaction_index}' end