Class: PciProxy::Model::CheckResult

Inherits:
Object
  • Object
show all
Defined in:
lib/pci_proxy/model/check_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_codeObject (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

#errorObject (readonly)

Returns the value of attribute error.



5
6
7
# File 'lib/pci_proxy/model/check_result.rb', line 5

def error
  @error
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/pci_proxy/model/check_result.rb', line 5

def response
  @response
end

#statusObject (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_idObject (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