Class: Worldline::Acquiring::SDK::V1::Domain::ApiCaptureRequest
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Acquiring::SDK::V1::Domain::ApiCaptureRequest
- Defined in:
- lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb
Instance Attribute Summary collapse
-
#amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
The current value of amount.
-
#capture_sequence_number ⇒ Integer
The current value of capture_sequence_number.
-
#dynamic_currency_conversion ⇒ Worldline::Acquiring::SDK::V1::Domain::DccData
The current value of dynamic_currency_conversion.
-
#is_final ⇒ true/false
The current value of is_final.
-
#operation_id ⇒ String
The current value of operation_id.
-
#transaction_timestamp ⇒ DateTime
The current value of transaction_timestamp.
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.
21 22 23 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb', line 21 def amount @amount end |
#capture_sequence_number ⇒ Integer
Returns the current value of capture_sequence_number.
21 22 23 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb', line 21 def capture_sequence_number @capture_sequence_number end |
#dynamic_currency_conversion ⇒ Worldline::Acquiring::SDK::V1::Domain::DccData
Returns the current value of dynamic_currency_conversion.
21 22 23 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb', line 21 def dynamic_currency_conversion @dynamic_currency_conversion end |
#is_final ⇒ true/false
Returns the current value of is_final.
21 22 23 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb', line 21 def is_final @is_final end |
#operation_id ⇒ String
Returns the current value of operation_id.
21 22 23 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb', line 21 def operation_id @operation_id end |
#transaction_timestamp ⇒ DateTime
Returns the current value of transaction_timestamp.
21 22 23 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb', line 21 def @transaction_timestamp end |
Instance Method Details
#from_hash(hash) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb', line 47 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? 'captureSequenceNumber' @capture_sequence_number = hash['captureSequenceNumber'] end if hash.has_key? 'dynamicCurrencyConversion' raise TypeError, "value '%s' is not a Hash" % [hash['dynamicCurrencyConversion']] unless hash['dynamicCurrencyConversion'].is_a? Hash @dynamic_currency_conversion = Worldline::Acquiring::SDK::V1::Domain::DccData.new_from_hash(hash['dynamicCurrencyConversion']) end if hash.has_key? 'isFinal' @is_final = hash['isFinal'] end if hash.has_key? 'operationId' @operation_id = hash['operationId'] end if hash.has_key? 'transactionTimestamp' @transaction_timestamp = DateTime.parse(hash['transactionTimestamp']) end end |
#to_h ⇒ Hash
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/worldline/acquiring/sdk/v1/domain/api_capture_request.rb', line 36 def to_h hash = super hash['amount'] = @amount.to_h unless @amount.nil? hash['captureSequenceNumber'] = @capture_sequence_number unless @capture_sequence_number.nil? hash['dynamicCurrencyConversion'] = @dynamic_currency_conversion.to_h unless @dynamic_currency_conversion.nil? hash['isFinal'] = @is_final unless @is_final.nil? hash['operationId'] = @operation_id unless @operation_id.nil? hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil? hash end |