class Ingenico::Direct::SDK::Domain::RefundOutput

@attr [Ingenico::Direct::SDK::Domain::AmountOfMoney] amount_of_money @attr [Long] amount_paid @attr [Ingenico::Direct::SDK::Domain::RefundCardMethodSpecificOutput] card_refund_method_specific_output @attr [Ingenico::Direct::SDK::Domain::RefundEWalletMethodSpecificOutput] e_wallet_refund_method_specific_output @attr [Ingenico::Direct::SDK::Domain::RefundMobileMethodSpecificOutput] mobile_refund_method_specific_output @attr [String] payment_method @attr [Ingenico::Direct::SDK::Domain::RefundRedirectMethodSpecificOutput] redirect_refund_method_specific_output @attr [Ingenico::Direct::SDK::Domain::PaymentReferences] references

Attributes

amount_of_money[RW]
amount_paid[RW]
card_refund_method_specific_output[RW]
e_wallet_refund_method_specific_output[RW]
mobile_refund_method_specific_output[RW]
payment_method[RW]
redirect_refund_method_specific_output[RW]
references[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/refund_output.rb, line 48
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
  @amount_paid = hash['amountPaid'] if hash.key? 'amountPaid'
  if hash.key? 'cardRefundMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardRefundMethodSpecificOutput']] unless hash['cardRefundMethodSpecificOutput'].is_a? Hash
    @card_refund_method_specific_output = Ingenico::Direct::SDK::Domain::RefundCardMethodSpecificOutput.new_from_hash(hash['cardRefundMethodSpecificOutput'])
  end
  if hash.key? 'eWalletRefundMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['eWalletRefundMethodSpecificOutput']] unless hash['eWalletRefundMethodSpecificOutput'].is_a? Hash
    @e_wallet_refund_method_specific_output = Ingenico::Direct::SDK::Domain::RefundEWalletMethodSpecificOutput.new_from_hash(hash['eWalletRefundMethodSpecificOutput'])
  end
  if hash.key? 'mobileRefundMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['mobileRefundMethodSpecificOutput']] unless hash['mobileRefundMethodSpecificOutput'].is_a? Hash
    @mobile_refund_method_specific_output = Ingenico::Direct::SDK::Domain::RefundMobileMethodSpecificOutput.new_from_hash(hash['mobileRefundMethodSpecificOutput'])
  end
  @payment_method = hash['paymentMethod'] if hash.key? 'paymentMethod'
  if hash.key? 'redirectRefundMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['redirectRefundMethodSpecificOutput']] unless hash['redirectRefundMethodSpecificOutput'].is_a? Hash
    @redirect_refund_method_specific_output = Ingenico::Direct::SDK::Domain::RefundRedirectMethodSpecificOutput.new_from_hash(hash['redirectRefundMethodSpecificOutput'])
  end
  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
end
to_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/refund_output.rb, line 35
def to_h
  hash = super
  hash['amountOfMoney'] = @amount_of_money.to_h if @amount_of_money
  hash['amountPaid'] = @amount_paid unless @amount_paid.nil?
  hash['cardRefundMethodSpecificOutput'] = @card_refund_method_specific_output.to_h if @card_refund_method_specific_output
  hash['eWalletRefundMethodSpecificOutput'] = @e_wallet_refund_method_specific_output.to_h if @e_wallet_refund_method_specific_output
  hash['mobileRefundMethodSpecificOutput'] = @mobile_refund_method_specific_output.to_h if @mobile_refund_method_specific_output
  hash['paymentMethod'] = @payment_method unless @payment_method.nil?
  hash['redirectRefundMethodSpecificOutput'] = @redirect_refund_method_specific_output.to_h if @redirect_refund_method_specific_output
  hash['references'] = @references.to_h if @references
  hash
end