Class: Adyen::REST::AuthorisePayment::Response

Inherits:
Response
  • Object
show all
Defined in:
lib/adyen/rest/authorise_payment.rb

Overview

The Response class implements some extensions for the authorise payment call.

See Also:

Instance Attribute Summary

Attributes inherited from Response

#attributes, #http_response, #prefix

Instance Method Summary collapse

Methods inherited from Response

#[], #has_attribute?, #initialize, #psp_reference

Constructor Details

This class inherits a constructor from Adyen::REST::Response

Instance Method Details

#authorised?Boolean Also known as: authorized?

Checks whether the authorisation was successful.



46
47
48
# File 'lib/adyen/rest/authorise_payment.rb', line 46

def authorised?
  result_code == AUTHORISED
end

#redirect_shopper?Boolean

Checks whether the result of the authorization call was RedirectShopper, which means that the customer has to be redirected away from your site to complete the 3Dsecure transaction.



63
64
65
# File 'lib/adyen/rest/authorise_payment.rb', line 63

def redirect_shopper?
  result_code == REDIRECT_SHOPPER
end

#refused?Boolean

Check whether the payment was refused.



54
55
56
# File 'lib/adyen/rest/authorise_payment.rb', line 54

def refused?
  result_code == REFUSED
end

#result_codeString

Returns the result code from the transaction.



72
73
74
# File 'lib/adyen/rest/authorise_payment.rb', line 72

def result_code
  self[:result_code]
end