Class: Ingenico::Direct::SDK::Domain::RefundOutput

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/refund_output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#amount_of_moneyIngenico::Direct::SDK::Domain::AmountOfMoney

Returns the current value of amount_of_money.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/refund_output.rb', line 24

def amount_of_money
  @amount_of_money
end

#amount_paidLong

Returns the current value of amount_paid.

Returns:

  • (Long)

    the current value of amount_paid



24
25
26
# File 'lib/ingenico/direct/sdk/domain/refund_output.rb', line 24

def amount_paid
  @amount_paid
end

#card_refund_method_specific_outputIngenico::Direct::SDK::Domain::RefundCardMethodSpecificOutput

Returns the current value of card_refund_method_specific_output.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/refund_output.rb', line 24

def card_refund_method_specific_output
  @card_refund_method_specific_output
end

#e_wallet_refund_method_specific_outputIngenico::Direct::SDK::Domain::RefundEWalletMethodSpecificOutput

Returns the current value of e_wallet_refund_method_specific_output.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/refund_output.rb', line 24

def e_wallet_refund_method_specific_output
  @e_wallet_refund_method_specific_output
end

#mobile_refund_method_specific_outputIngenico::Direct::SDK::Domain::RefundMobileMethodSpecificOutput

Returns the current value of mobile_refund_method_specific_output.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/refund_output.rb', line 24

def mobile_refund_method_specific_output
  @mobile_refund_method_specific_output
end

#payment_methodString

Returns the current value of payment_method.

Returns:

  • (String)

    the current value of payment_method



24
25
26
# File 'lib/ingenico/direct/sdk/domain/refund_output.rb', line 24

def payment_method
  @payment_method
end

#redirect_refund_method_specific_outputIngenico::Direct::SDK::Domain::RefundRedirectMethodSpecificOutput

Returns the current value of redirect_refund_method_specific_output.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/refund_output.rb', line 24

def redirect_refund_method_specific_output
  @redirect_refund_method_specific_output
end

#referencesIngenico::Direct::SDK::Domain::PaymentReferences

Returns the current value of references.

Returns:



24
25
26
# File 'lib/ingenico/direct/sdk/domain/refund_output.rb', line 24

def references
  @references
end

Instance Method Details

#from_hash(hash) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# 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_hHash

Returns:

  • (Hash)


35
36
37
38
39
40
41
42
43
44
45
46
# 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