Class: Worldline::Acquiring::SDK::V1::Domain::TransactionDataForDcc
- Inherits:
-
Domain::DataObject
- Object
- Domain::DataObject
- Worldline::Acquiring::SDK::V1::Domain::TransactionDataForDcc
- Defined in:
- lib/worldline/acquiring/sdk/v1/domain/transaction_data_for_dcc.rb
Instance Attribute Summary collapse
-
#amount ⇒ Worldline::Acquiring::SDK::V1::Domain::AmountData
The current value of amount.
-
#transaction_timestamp ⇒ DateTime
The current value of transaction_timestamp.
-
#transaction_type ⇒ String
The current value of transaction_type.
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.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/domain/transaction_data_for_dcc.rb', line 17 def amount @amount end |
#transaction_timestamp ⇒ DateTime
Returns the current value of transaction_timestamp.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/domain/transaction_data_for_dcc.rb', line 17 def @transaction_timestamp end |
#transaction_type ⇒ String
Returns the current value of transaction_type.
17 18 19 |
# File 'lib/worldline/acquiring/sdk/v1/domain/transaction_data_for_dcc.rb', line 17 def transaction_type @transaction_type end |
Instance Method Details
#from_hash(hash) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/worldline/acquiring/sdk/v1/domain/transaction_data_for_dcc.rb', line 34 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? 'transactionTimestamp' @transaction_timestamp = DateTime.parse(hash['transactionTimestamp']) end if hash.has_key? 'transactionType' @transaction_type = hash['transactionType'] end end |
#to_h ⇒ Hash
26 27 28 29 30 31 32 |
# File 'lib/worldline/acquiring/sdk/v1/domain/transaction_data_for_dcc.rb', line 26 def to_h hash = super hash['amount'] = @amount.to_h unless @amount.nil? hash['transactionTimestamp'] = @transaction_timestamp.iso8601(3) unless @transaction_timestamp.nil? hash['transactionType'] = @transaction_type unless @transaction_type.nil? hash end |