Class: Xpay::Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/xpay/transaction.rb

Overview

The transaction class is the parent class of all Transactions be it Payment, Refund or Paypal etc. it provides underlying methods which all transactions have in common It should not be instantiated by itself

Direct Known Subclasses

Payment, TransactionQuery

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#request_xmlObject

Returns the value of attribute request_xml.



10
11
12
# File 'lib/xpay/transaction.rb', line 10

def request_xml
  @request_xml
end

#response_blockObject (readonly)

Returns the value of attribute response_block.



11
12
13
# File 'lib/xpay/transaction.rb', line 11

def response_block
  @response_block
end

#response_xmlObject

Returns the value of attribute response_xml.



11
12
13
# File 'lib/xpay/transaction.rb', line 11

def response_xml
  @response_xml
end

#three_secureObject (readonly)

Returns the value of attribute three_secure.



11
12
13
# File 'lib/xpay/transaction.rb', line 11

def three_secure
  @three_secure
end

Instance Method Details

#request_methodObject



14
15
16
# File 'lib/xpay/transaction.rb', line 14

def request_method
  @request_method ||= REXML::XPath.first(@request_xml, "//Request").attributes["Type"]
end

#response_codeObject



18
19
20
# File 'lib/xpay/transaction.rb', line 18

def response_code
  REXML::XPath.first(@response_xml, "//Result").text.to_i rescue nil
end