Class: OnlinePayments::SDK::Domain::PayoutOutput
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::PayoutOutput
- Defined in:
- lib/onlinepayments/sdk/domain/payout_output.rb
Instance Attribute Summary collapse
-
#amount_of_money ⇒ OnlinePayments::SDK::Domain::AmountOfMoney
The current value of amount_of_money.
-
#payout_card_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::PayoutCardPaymentMethodSpecificOutput
The current value of payout_card_payment_method_specific_output.
-
#payout_reason ⇒ String
The current value of payout_reason.
-
#references ⇒ OnlinePayments::SDK::Domain::PaymentReferences
The current value of references.
-
#transaction_date ⇒ DateTime
The current value of transaction_date.
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.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payout_output.rb', line 19 def amount_of_money @amount_of_money end |
#payout_card_payment_method_specific_output ⇒ OnlinePayments::SDK::Domain::PayoutCardPaymentMethodSpecificOutput
Returns the current value of payout_card_payment_method_specific_output.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payout_output.rb', line 19 def payout_card_payment_method_specific_output @payout_card_payment_method_specific_output end |
#payout_reason ⇒ String
Returns the current value of payout_reason.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payout_output.rb', line 19 def payout_reason @payout_reason end |
#references ⇒ OnlinePayments::SDK::Domain::PaymentReferences
Returns the current value of references.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payout_output.rb', line 19 def references @references end |
#transaction_date ⇒ DateTime
Returns the current value of transaction_date.
19 20 21 |
# File 'lib/onlinepayments/sdk/domain/payout_output.rb', line 19 def transaction_date @transaction_date end |
Instance Method Details
#from_hash(hash) ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/onlinepayments/sdk/domain/payout_output.rb', line 42 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? 'payoutCardPaymentMethodSpecificOutput' raise TypeError, "value '%s' is not a Hash" % [hash['payoutCardPaymentMethodSpecificOutput']] unless hash['payoutCardPaymentMethodSpecificOutput'].is_a? Hash @payout_card_payment_method_specific_output = OnlinePayments::SDK::Domain::PayoutCardPaymentMethodSpecificOutput.new_from_hash(hash['payoutCardPaymentMethodSpecificOutput']) end if hash.has_key? 'payoutReason' @payout_reason = hash['payoutReason'] end if hash.has_key? 'references' raise TypeError, "value '%s' is not a Hash" % [hash['references']] unless hash['references'].is_a? Hash @references = OnlinePayments::SDK::Domain::PaymentReferences.new_from_hash(hash['references']) end if hash.has_key? 'transactionDate' @transaction_date = DateTime.parse(hash['transactionDate']) end end |
#to_h ⇒ Hash
32 33 34 35 36 37 38 39 40 |
# File 'lib/onlinepayments/sdk/domain/payout_output.rb', line 32 def to_h hash = super hash['amountOfMoney'] = @amount_of_money.to_h unless @amount_of_money.nil? hash['payoutCardPaymentMethodSpecificOutput'] = @payout_card_payment_method_specific_output.to_h unless @payout_card_payment_method_specific_output.nil? hash['payoutReason'] = @payout_reason unless @payout_reason.nil? hash['references'] = @references.to_h unless @references.nil? hash['transactionDate'] = @transaction_date.iso8601(3) unless @transaction_date.nil? hash end |