Class: OnlinePayments::SDK::Domain::CancelPaymentRequest
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::CancelPaymentRequest
- Defined in:
- lib/onlinepayments/sdk/domain/cancel_payment_request.rb
Instance Attribute Summary collapse
-
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
The current value of amount_of_money.
-
#is_final ⇒ true/false
The current value of is_final.
-
#operation_references ⇒ OnlinePayments::SDK::Domain::OperationPaymentReferences
The current value of operation_references.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
Returns the current value of amount_of_money.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/cancel_payment_request.rb', line 14 def amount_of_money @amount_of_money end |
#is_final ⇒ true/false
Returns the current value of is_final.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/cancel_payment_request.rb', line 14 def is_final @is_final end |
#operation_references ⇒ OnlinePayments::SDK::Domain::OperationPaymentReferences
Returns the current value of operation_references.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/cancel_payment_request.rb', line 14 def operation_references @operation_references end |
Instance Method Details
#from_hash(hash) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/onlinepayments/sdk/domain/cancel_payment_request.rb', line 31 def from_hash(hash) super if hash.has_key? 'amountOfMoney' raise TypeError, "value '%s' is not a Hash" % [hash['amountOfMoney']] unless hash['amountOfMoney'].is_a? Hash @amount_of_money = OnlinePayments::SDK::Domain::AmountOfMoney.new_from_hash(hash['amountOfMoney']) end if hash.has_key? 'isFinal' @is_final = hash['isFinal'] end if hash.has_key? 'operationReferences' raise TypeError, "value '%s' is not a Hash" % [hash['operationReferences']] unless hash['operationReferences'].is_a? Hash @operation_references = OnlinePayments::SDK::Domain::OperationPaymentReferences.new_from_hash(hash['operationReferences']) end end |
#to_h ⇒ Hash
23 24 25 26 27 28 29 |
# File 'lib/onlinepayments/sdk/domain/cancel_payment_request.rb', line 23 def to_h hash = super hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil? hash['isFinal'] = @is_final unless @is_final.nil? hash['operationReferences'] = @operation_references.to_h unless @operation_references.nil? hash end |