Class: EwayRapid::CancelAuthorisationResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/eway_rapid/entities/cancel_authorisation_response.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



7
8
9
# File 'lib/eway_rapid/entities/cancel_authorisation_response.rb', line 7

def errors
  @errors
end

#response_codeObject

Returns the value of attribute response_code.



3
4
5
# File 'lib/eway_rapid/entities/cancel_authorisation_response.rb', line 3

def response_code
  @response_code
end

#response_messageObject

Returns the value of attribute response_message.



4
5
6
# File 'lib/eway_rapid/entities/cancel_authorisation_response.rb', line 4

def response_message
  @response_message
end

#transaction_idObject

Returns the value of attribute transaction_id.



5
6
7
# File 'lib/eway_rapid/entities/cancel_authorisation_response.rb', line 5

def transaction_id
  @transaction_id
end

#transaction_statusObject Also known as: transaction_status?

Returns the value of attribute transaction_status.



6
7
8
# File 'lib/eway_rapid/entities/cancel_authorisation_response.rb', line 6

def transaction_status
  @transaction_status
end

Class Method Details

.from_hash(hash) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/eway_rapid/entities/cancel_authorisation_response.rb', line 24

def self.from_hash(hash)
  cancel_authorisation_response = CancelAuthorisationResponse.new
  cancel_authorisation_response.response_code = hash[Constants::RESPONSE_CODE]
  cancel_authorisation_response.response_message = hash[Constants::RESPONSE_MESSAGE]
  cancel_authorisation_response.transaction_id = hash[Constants::TRANSACTION_ID]
  cancel_authorisation_response.transaction_status = hash[Constants::TRANSACTION_STATUS]
  cancel_authorisation_response.errors = hash[Constants::ERRORS_CAPITALIZED]
  cancel_authorisation_response
end

.from_json(json) ⇒ Object



19
20
21
22
# File 'lib/eway_rapid/entities/cancel_authorisation_response.rb', line 19

def self.from_json(json)
  hash = JSON.parse(json)
  from_hash(hash)
end

Instance Method Details

#to_json(options = {}) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/eway_rapid/entities/cancel_authorisation_response.rb', line 11

def to_json(options={})
  { Constants::RESPONSE_CODE => response_code,
   Constants::RESPONSE_MESSAGE => response_message,
   Constants::TRANSACTION_ID => transaction_id,
   Constants::TRANSACTION_STATUS => transaction_status,
   Constants::ERRORS => errors }.to_json
end