Class: ActiveMerchant::Billing::PaymentechOrbital::Request::Base

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

Direct Known Subclasses

EndOfDay, NewOrder, ProfileManagement, Void

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



10
11
12
# File 'lib/active_merchant/billing/paymentech_orbital/request.rb', line 10

def initialize(options={})
  @options = OpenStruct.new(options)
end

Instance Attribute Details

#gatewayObject (readonly)

Returns the value of attribute gateway.



8
9
10
# File 'lib/active_merchant/billing/paymentech_orbital/request.rb', line 8

def gateway
  @gateway
end

#optionsObject (readonly)

Returns the value of attribute options.



8
9
10
# File 'lib/active_merchant/billing/paymentech_orbital/request.rb', line 8

def options
  @options
end

Instance Method Details

#addressObject



29
30
31
# File 'lib/active_merchant/billing/paymentech_orbital/request.rb', line 29

def address
  @_address ||= options.billing_address || options.address || {}
end

#full_street_addressObject



38
39
40
# File 'lib/active_merchant/billing/paymentech_orbital/request.rb', line 38

def full_street_address
  "#{address[:address1]} #{address[:address2]}".strip
end

#headersObject



19
20
21
# File 'lib/active_merchant/billing/paymentech_orbital/request.rb', line 19

def headers
  @_headers ||= options.headers || {}
end

#to_aObject



23
24
25
26
27
# File 'lib/active_merchant/billing/paymentech_orbital/request.rb', line 23

def to_a
  [ to_s, Time.now, merchant_id, order_id, industry_type,
    money, currency_code, customer_ref_num, address[:phone],
    address[:name], full_street_address ]
end

#to_xmlObject Also known as: xml



14
15
16
# File 'lib/active_merchant/billing/paymentech_orbital/request.rb', line 14

def to_xml
  @_xml ||= build_request
end