Class: PciProxy::Model::CheckResult
- Inherits:
-
Object
- Object
- PciProxy::Model::CheckResult
- Defined in:
- lib/pci_proxy/model/check_result.rb
Instance Attribute Summary collapse
-
#auth_code ⇒ Object
readonly
Returns the value of attribute auth_code.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#transaction_id ⇒ Object
readonly
Returns the value of attribute transaction_id.
Instance Method Summary collapse
-
#initialize(response) ⇒ CheckResult
constructor
A new instance of CheckResult.
Constructor Details
#initialize(response) ⇒ CheckResult
Returns a new instance of CheckResult.
7 8 9 10 11 12 13 14 |
# File 'lib/pci_proxy/model/check_result.rb', line 7 def initialize(response) @response = response @auth_code = response["acquirerAuthorizationCode"] @transaction_id = response["transactionId"] @error = response["error"] @status = @auth_code && @transaction_id && !@error ? :success : :error end |
Instance Attribute Details
#auth_code ⇒ Object (readonly)
Returns the value of attribute auth_code.
5 6 7 |
# File 'lib/pci_proxy/model/check_result.rb', line 5 def auth_code @auth_code end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
5 6 7 |
# File 'lib/pci_proxy/model/check_result.rb', line 5 def error @error end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/pci_proxy/model/check_result.rb', line 5 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/pci_proxy/model/check_result.rb', line 5 def status @status end |
#transaction_id ⇒ Object (readonly)
Returns the value of attribute transaction_id.
5 6 7 |
# File 'lib/pci_proxy/model/check_result.rb', line 5 def transaction_id @transaction_id end |