Class: Adyen::AdyenResult

Inherits:
Object
  • Object
show all
Defined in:
lib/adyen/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, header, status) ⇒ AdyenResult

Returns a new instance of AdyenResult.



7
8
9
10
11
12
13
14
# File 'lib/adyen/result.rb', line 7

def initialize(response, header, status)
  @response = JSON.parse(response, object_class: HashWithAccessors)

  # `header` in Faraday response is not a JSON string, but rather a
  # Faraday `Headers` object. Convert first before parsing
  @header = JSON.parse(header.to_json, object_class: HashWithAccessors)
  @status = status
end

Instance Attribute Details

#headerObject (readonly)

Returns the value of attribute header.



5
6
7
# File 'lib/adyen/result.rb', line 5

def header
  @header
end

#responseObject (readonly)

Returns the value of attribute response.



5
6
7
# File 'lib/adyen/result.rb', line 5

def response
  @response
end

#statusObject (readonly)

Returns the value of attribute status.



5
6
7
# File 'lib/adyen/result.rb', line 5

def status
  @status
end