Class: Ingenico::Direct::SDK::Domain::OperationOutput
- Inherits:
-
Ingenico::Direct::SDK::DataObject
- Object
- Ingenico::Direct::SDK::DataObject
- Ingenico::Direct::SDK::Domain::OperationOutput
- Defined in:
- lib/ingenico/direct/sdk/domain/operation_output.rb
Instance Attribute Summary collapse
-
#amount_of_money ⇒ Ingenico::Direct::SDK::Domain::AmountOfMoney
The current value of amount_of_money.
-
#id ⇒ String
The current value of id.
-
#payment_method ⇒ String
The current value of payment_method.
-
#references ⇒ Ingenico::Direct::SDK::Domain::PaymentReferences
The current value of references.
-
#status ⇒ String
The current value of status.
-
#status_output ⇒ Ingenico::Direct::SDK::Domain::PaymentStatusOutput
The current value of status_output.
Instance Method Summary collapse
Methods inherited from Ingenico::Direct::SDK::DataObject
Instance Attribute Details
#amount_of_money ⇒ Ingenico::Direct::SDK::Domain::AmountOfMoney
Returns the current value of amount_of_money.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/operation_output.rb', line 19 def amount_of_money @amount_of_money end |
#id ⇒ String
Returns the current value of id.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/operation_output.rb', line 19 def id @id end |
#payment_method ⇒ String
Returns the current value of payment_method.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/operation_output.rb', line 19 def payment_method @payment_method end |
#references ⇒ Ingenico::Direct::SDK::Domain::PaymentReferences
Returns the current value of references.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/operation_output.rb', line 19 def references @references end |
#status ⇒ String
Returns the current value of status.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/operation_output.rb', line 19 def status @status end |
#status_output ⇒ Ingenico::Direct::SDK::Domain::PaymentStatusOutput
Returns the current value of status_output.
19 20 21 |
# File 'lib/ingenico/direct/sdk/domain/operation_output.rb', line 19 def status_output @status_output end |
Instance Method Details
#from_hash(hash) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ingenico/direct/sdk/domain/operation_output.rb', line 39 def from_hash(hash) super if hash.key? 'amountOfMoney' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash @amount_of_money = Ingenico::Direct::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney']) end @id = hash['id'] if hash.key? 'id' @payment_method = hash['paymentMethod'] if hash.key? 'paymentMethod' if hash.key? 'references' raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash @references = Ingenico::Direct::SDK::Domain::PaymentReferences.new_from_hash(hash['references']) end @status = hash['status'] if hash.key? 'status' if hash.key? 'statusOutput' raise TypeError, "value '%s' is not a Hash" % [hash['statusOutput']] unless hash['statusOutput'].is_a? Hash @status_output = Ingenico::Direct::SDK::Domain::PaymentStatusOutput.new_from_hash(hash['statusOutput']) end end |
#to_h ⇒ Hash
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ingenico/direct/sdk/domain/operation_output.rb', line 28 def to_h hash = super hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money hash['id'] = @id unless @id.nil? hash['paymentMethod'] = @payment_method unless @payment_method.nil? hash['references'] = @references.to_h if @references hash['status'] = @status unless @status.nil? hash['statusOutput'] = @status_output.to_h if @status_output hash end |