Class: Ingenico::Connect::SDK::Domain::Payment::RefundOutput

Inherits:
OrderOutput show all
Defined in:
lib/ingenico/connect/sdk/domain/payment/refund_output.rb

Instance Attribute Summary collapse

Attributes inherited from OrderOutput

#amount_of_money, #references

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#amount_paidInteger



25
26
27
# File 'lib/ingenico/connect/sdk/domain/payment/refund_output.rb', line 25

def amount_paid
  @amount_paid
end

#bank_refund_method_specific_outputIngenico::Connect::SDK::Domain::Payment::RefundBankMethodSpecificOutput



25
26
27
# File 'lib/ingenico/connect/sdk/domain/payment/refund_output.rb', line 25

def bank_refund_method_specific_output
  @bank_refund_method_specific_output
end

#card_refund_method_specific_outputIngenico::Connect::SDK::Domain::Payment::RefundCardMethodSpecificOutput



25
26
27
# File 'lib/ingenico/connect/sdk/domain/payment/refund_output.rb', line 25

def card_refund_method_specific_output
  @card_refund_method_specific_output
end

#cash_refund_method_specific_outputIngenico::Connect::SDK::Domain::Payment::RefundCashMethodSpecificOutput



25
26
27
# File 'lib/ingenico/connect/sdk/domain/payment/refund_output.rb', line 25

def cash_refund_method_specific_output
  @cash_refund_method_specific_output
end

#e_invoice_refund_method_specific_outputIngenico::Connect::SDK::Domain::Payment::RefundEInvoiceMethodSpecificOutput



25
26
27
# File 'lib/ingenico/connect/sdk/domain/payment/refund_output.rb', line 25

def e_invoice_refund_method_specific_output
  @e_invoice_refund_method_specific_output
end

#e_wallet_refund_method_specific_outputIngenico::Connect::SDK::Domain::Payment::RefundEWalletMethodSpecificOutput



25
26
27
# File 'lib/ingenico/connect/sdk/domain/payment/refund_output.rb', line 25

def e_wallet_refund_method_specific_output
  @e_wallet_refund_method_specific_output
end

#mobile_refund_method_specific_outputIngenico::Connect::SDK::Domain::Payment::RefundMobileMethodSpecificOutput



25
26
27
# File 'lib/ingenico/connect/sdk/domain/payment/refund_output.rb', line 25

def mobile_refund_method_specific_output
  @mobile_refund_method_specific_output
end

#payment_methodString



25
26
27
# File 'lib/ingenico/connect/sdk/domain/payment/refund_output.rb', line 25

def payment_method
  @payment_method
end

Instance Method Details

#from_hash(hash) ⇒ Object



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/ingenico/connect/sdk/domain/payment/refund_output.rb', line 57

def from_hash(hash)
  super
  if hash.has_key? 'amountPaid'
    @amount_paid = hash['amountPaid']
  end
  if hash.has_key? 'bankRefundMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['bankRefundMethodSpecificOutput']] unless hash['bankRefundMethodSpecificOutput'].is_a? Hash
    @bank_refund_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::RefundBankMethodSpecificOutput.new_from_hash(hash['bankRefundMethodSpecificOutput'])
  end
  if hash.has_key? 'cardRefundMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardRefundMethodSpecificOutput']] unless hash['cardRefundMethodSpecificOutput'].is_a? Hash
    @card_refund_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::RefundCardMethodSpecificOutput.new_from_hash(hash['cardRefundMethodSpecificOutput'])
  end
  if hash.has_key? 'cashRefundMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cashRefundMethodSpecificOutput']] unless hash['cashRefundMethodSpecificOutput'].is_a? Hash
    @cash_refund_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::RefundCashMethodSpecificOutput.new_from_hash(hash['cashRefundMethodSpecificOutput'])
  end
  if hash.has_key? 'eInvoiceRefundMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['eInvoiceRefundMethodSpecificOutput']] unless hash['eInvoiceRefundMethodSpecificOutput'].is_a? Hash
    @e_invoice_refund_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::RefundEInvoiceMethodSpecificOutput.new_from_hash(hash['eInvoiceRefundMethodSpecificOutput'])
  end
  if hash.has_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::Connect::SDK::Domain::Payment::RefundEWalletMethodSpecificOutput.new_from_hash(hash['eWalletRefundMethodSpecificOutput'])
  end
  if hash.has_key? 'mobileRefundMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['mobileRefundMethodSpecificOutput']] unless hash['mobileRefundMethodSpecificOutput'].is_a? Hash
    @mobile_refund_method_specific_output = Ingenico::Connect::SDK::Domain::Payment::RefundMobileMethodSpecificOutput.new_from_hash(hash['mobileRefundMethodSpecificOutput'])
  end
  if hash.has_key? 'paymentMethod'
    @payment_method = hash['paymentMethod']
  end
end

#to_hHash



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/ingenico/connect/sdk/domain/payment/refund_output.rb', line 44

def to_h
  hash = super
  hash['amountPaid'] = @amount_paid unless @amount_paid.nil?
  hash['bankRefundMethodSpecificOutput'] = @bank_refund_method_specific_output.to_h unless @bank_refund_method_specific_output.nil?
  hash['cardRefundMethodSpecificOutput'] = @card_refund_method_specific_output.to_h unless @card_refund_method_specific_output.nil?
  hash['cashRefundMethodSpecificOutput'] = @cash_refund_method_specific_output.to_h unless @cash_refund_method_specific_output.nil?
  hash['eInvoiceRefundMethodSpecificOutput'] = @e_invoice_refund_method_specific_output.to_h unless @e_invoice_refund_method_specific_output.nil?
  hash['eWalletRefundMethodSpecificOutput'] = @e_wallet_refund_method_specific_output.to_h unless @e_wallet_refund_method_specific_output.nil?
  hash['mobileRefundMethodSpecificOutput'] = @mobile_refund_method_specific_output.to_h unless @mobile_refund_method_specific_output.nil?
  hash['paymentMethod'] = @payment_method unless @payment_method.nil?
  hash
end