Class: ActiveMerchant::Billing::PaymentechOrbital::Gateway

Inherits:
Gateway
  • Object
show all
Defined in:
lib/active_merchant/billing/paymentech_orbital/gateway.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Gateway

Returns a new instance of Gateway.



48
49
50
51
52
53
54
55
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 48

def initialize(options = {})
  requires!(options, :login, :password, :merchant_id, :bin, :terminal_id)
  @options = options.merge({
    :currency_code => self.class.currency_code,
    :currency_exponent => self.class.currency_exponent
  })
  super
end

Instance Attribute Details

#requestObject (readonly)

Returns the value of attribute request.



46
47
48
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 46

def request
  @request
end

#responseObject (readonly)

Returns the value of attribute response.



46
47
48
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 46

def response
  @response
end

Instance Method Details

#authorize(money, credit_card = nil, options = {}) ⇒ Object



57
58
59
60
61
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 57

def authorize(money, credit_card=nil, options = {})
  @request = Request::NewOrder.new("A", money, credit_card, options.merge(@options))

  commit('authonly', @request)
end

#end_of_day(options = {}) ⇒ Object



87
88
89
90
91
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 87

def end_of_day(options={})
  @request = Request::EndOfDay.new(options.merge(@options))

  commit('end of day', @request)
end

#profile(action, credit_card = nil, options = {}) ⇒ Object



75
76
77
78
79
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 75

def profile(action, credit_card=nil, options={})
  @request = Request::ProfileManagement.new(action, credit_card, options.merge(@options))

  commit("profile-#{action}", @request)
end

#purchase(money, credit_card = nil, options = {}) ⇒ Object



63
64
65
66
67
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 63

def purchase(money, credit_card=nil, options = {})
  @request = Request::NewOrder.new("AC", money, credit_card, options.merge(@options))

  commit('sale', @request)
end

#refund(money, credit_card = nil, options = {}) ⇒ Object



69
70
71
72
73
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 69

def refund(money, credit_card=nil, options={})
  @request = Request::NewOrder.new("R", money, credit_card, options.merge(@options))

  commit('refund', @request)
end

#to_aObject



93
94
95
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 93

def to_a
  request.to_a + response.to_a
end

#void(tx_ref_num, tx_ref_idx, money = nil, options = {}) ⇒ Object



81
82
83
84
85
# File 'lib/active_merchant/billing/paymentech_orbital/gateway.rb', line 81

def void(tx_ref_num, tx_ref_idx, money=nil, options={})
  @request = Request::Void.new(tx_ref_num, tx_ref_idx, money, options.merge(@options))

  commit('void', @request)
end