Class: Worldline::Acquiring::SDK::V1::Domain::SubOperation
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Acquiring::SDK::V1::Domain::SubOperation
- Defined in:
- lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb
Instance Attribute Summary collapse
-
#amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
The current value of amount.
-
#authorization_code ⇒ String
The current value of authorization_code.
-
#operation_id ⇒ String
The current value of operation_id.
-
#operation_timestamp ⇒ DateTime
The current value of operation_timestamp.
-
#operation_type ⇒ String
The current value of operation_type.
-
#response_code ⇒ String
The current value of response_code.
-
#response_code_category ⇒ String
The current value of response_code_category.
-
#response_code_description ⇒ String
The current value of response_code_description.
-
#retry_after ⇒ String
The current value of retry_after.
Instance Method Summary collapse
Methods inherited from Domain::DataObject
Instance Attribute Details
#amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
Returns the current value of amount.
23 24 25 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 23 def amount @amount end |
#authorization_code ⇒ String
Returns the current value of authorization_code.
23 24 25 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 23 def @authorization_code end |
#operation_id ⇒ String
Returns the current value of operation_id.
23 24 25 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 23 def operation_id @operation_id end |
#operation_timestamp ⇒ DateTime
Returns the current value of operation_timestamp.
23 24 25 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 23 def @operation_timestamp end |
#operation_type ⇒ String
Returns the current value of operation_type.
23 24 25 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 23 def operation_type @operation_type end |
#response_code ⇒ String
Returns the current value of response_code.
23 24 25 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 23 def response_code @response_code end |
#response_code_category ⇒ String
Returns the current value of response_code_category.
23 24 25 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 23 def response_code_category @response_code_category end |
#response_code_description ⇒ String
Returns the current value of response_code_description.
23 24 25 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 23 def response_code_description @response_code_description end |
#retry_after ⇒ String
Returns the current value of retry_after.
23 24 25 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 23 def retry_after @retry_after end |
Instance Method Details
#from_hash(hash) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 58 def from_hash(hash) super if hash.has_key? 'amount' raise TypeError, "value '%s' is not a Hash" % [hash['amount']] unless hash['amount'].is_a? Hash @amount = Worldline::Acquiring::SDK::V1::Domain::AmountData.new_from_hash(hash['amount']) end if hash.has_key? 'authorizationCode' @authorization_code = hash['authorizationCode'] end if hash.has_key? 'operationId' @operation_id = hash['operationId'] end if hash.has_key? 'operationTimestamp' @operation_timestamp = DateTime.parse(hash['operationTimestamp']) end if hash.has_key? 'operationType' @operation_type = hash['operationType'] end if hash.has_key? 'responseCode' @response_code = hash['responseCode'] end if hash.has_key? 'responseCodeCategory' @response_code_category = hash['responseCodeCategory'] end if hash.has_key? 'responseCodeDescription' @response_code_description = hash['responseCodeDescription'] end if hash.has_key? 'retryAfter' @retry_after = hash['retryAfter'] end end |
#to_h ⇒ Hash
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/worldline/acquiring/sdk/v1/domain/sub_operation.rb', line 44 def to_h hash = super hash['amount'] = @amount.to_h unless @amount.nil? hash['authorizationCode'] = @authorization_code unless @authorization_code.nil? hash['operationId'] = @operation_id unless @operation_id.nil? hash['operationTimestamp'] = @operation_timestamp.iso8601(3) unless @operation_timestamp.nil? hash['operationType'] = @operation_type unless @operation_type.nil? hash['responseCode'] = @response_code unless @response_code.nil? hash['responseCodeCategory'] = @response_code_category unless @response_code_category.nil? hash['responseCodeDescription'] = @response_code_description unless @response_code_description.nil? hash['retryAfter'] = @retry_after unless @retry_after.nil? hash end |