Class: OnlinePayments::SDK::Domain::PayoutOutput

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/payout_output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#amount_of_moneyOnlinePayments::SDK::Domain::AmountOfMoney

Returns the current value of amount_of_money.

Returns:



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_outputOnlinePayments::SDK::Domain::PayoutCardPaymentMethodSpecificOutput

Returns the current value of payout_card_payment_method_specific_output.

Returns:



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_reasonString

Returns the current value of payout_reason.

Returns:

  • (String)

    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

#referencesOnlinePayments::SDK::Domain::PaymentReferences

Returns the current value of references.

Returns:



19
20
21
# File 'lib/onlinepayments/sdk/domain/payout_output.rb', line 19

def references
  @references
end

#transaction_dateDateTime

Returns the current value of transaction_date.

Returns:

  • (DateTime)

    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_hHash

Returns:

  • (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