Class: PayXML::Auth::Request

Inherits:
Message
  • Object
show all
Defined in:
lib/payxml/auth.rb

Constant Summary

Constants inherited from Message

Message::PAYXML_VERSION_NUMBER

Instance Attribute Summary collapse

Attributes inherited from Message

#paygate_id, #paygate_password

Instance Method Summary collapse

Methods inherited from Message

#xml_string

Constructor Details

#initialize(paygate_id, paygate_password) ⇒ Request

Returns a new instance of Request.



17
18
19
20
21
22
# File 'lib/payxml/auth.rb', line 17

def initialize(paygate_id, paygate_password)
  super(paygate_id, paygate_password)

  @budget_period = 0
  @bno = ''
end

Instance Attribute Details

#amountObject

Returns the value of attribute amount.



7
8
9
# File 'lib/payxml/auth.rb', line 7

def amount
  @amount
end

#bnoObject

Returns the value of attribute bno.



9
10
11
# File 'lib/payxml/auth.rb', line 9

def bno
  @bno
end

#budget_periodObject

Returns the value of attribute budget_period.



6
7
8
# File 'lib/payxml/auth.rb', line 6

def budget_period
  @budget_period
end

#credit_card_numberObject

Returns the value of attribute credit_card_number.



10
11
12
# File 'lib/payxml/auth.rb', line 10

def credit_card_number
  @credit_card_number
end

#currencyObject

Returns the value of attribute currency.



8
9
10
# File 'lib/payxml/auth.rb', line 8

def currency
  @currency
end

#customer_ip_addressObject

Returns the value of attribute customer_ip_address.



13
14
15
# File 'lib/payxml/auth.rb', line 13

def customer_ip_address
  @customer_ip_address
end

#customer_nameObject

Returns the value of attribute customer_name.



4
5
6
# File 'lib/payxml/auth.rb', line 4

def customer_name
  @customer_name
end

#customer_referenceObject

Returns the value of attribute customer_reference.



5
6
7
# File 'lib/payxml/auth.rb', line 5

def customer_reference
  @customer_reference
end

#cvvObject

Returns the value of attribute cvv.



11
12
13
# File 'lib/payxml/auth.rb', line 11

def cvv
  @cvv
end

#expiry_dateObject

Returns the value of attribute expiry_date.



12
13
14
# File 'lib/payxml/auth.rb', line 12

def expiry_date
  @expiry_date
end

#notify_callback_urlObject

Returns the value of attribute notify_callback_url.



14
15
16
# File 'lib/payxml/auth.rb', line 14

def notify_callback_url
  @notify_callback_url
end

#response_urlObject

Returns the value of attribute response_url.



15
16
17
# File 'lib/payxml/auth.rb', line 15

def response_url
  @response_url
end

Instance Method Details

#parse(xml_string) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/payxml/auth.rb', line 24

def parse(xml_string)
  super(xml_string)

  doc = Nokogiri::XML(xml_string)
  authtx = doc.xpath("//authtx").first
  self.customer_reference = authtx['cref'] unless authtx['cref'].nil?
  # self.customer_name = authtx['cname']
  # self.credit_card_number = authtx['cc']
  # self.expiry_date = authtx['exp']
  # self.cvv = authtx['cvv']
  # self.budget_period = authtx['budp']
  # self.currency = authtx['cur']
end