Class: Ideal::TransactionResponse

Inherits:
Response
  • Object
show all
Defined in:
lib/ideal/response.rb

Overview

An instance of TransactionResponse is returned from Gateway#setup_purchase which returns the service_url to where the user should be redirected to perform the transaction and the transaction ID.

Instance Attribute Summary

Attributes inherited from Response

#response

Instance Method Summary collapse

Methods inherited from Response

#consumer_error_message, #error_code, #error_details, #error_message, #error_type, #initialize, #success?, #test?

Constructor Details

This class inherits a constructor from Ideal::Response

Instance Method Details

#order_idObject

Returns the :order_id for this transaction.



185
186
187
# File 'lib/ideal/response.rb', line 185

def order_id
  text('//purchaseID')
end

#service_urlObject

Returns the URL to the issuer’s page where the consumer should be redirected to in order to perform the payment.



169
170
171
# File 'lib/ideal/response.rb', line 169

def service_url
  CGI::unescapeHTML(text('//issuerAuthenticationURL')).strip
end

#signatureObject



189
190
191
# File 'lib/ideal/response.rb', line 189

def signature
  Base64.decode64(text('//SignatureValue'))
end

#transaction_idObject

Returns the transaction ID which is needed for requesting the status of a transaction. See Gateway#capture.



180
181
182
# File 'lib/ideal/response.rb', line 180

def transaction_id
  text('//transactionID')
end

#verified?Boolean

Returns:

  • (Boolean)


173
174
175
176
# File 'lib/ideal/response.rb', line 173

def verified?
  signed_document = Xmldsig::SignedDocument.new(@body)
  @verified ||= signed_document.validate(Ideal::Gateway.ideal_certificate)
end