Class: Worldline::Connect::SDK::V1::Domain::RefundOutput

Inherits:
OrderOutput show all
Defined in:
lib/worldline/connect/sdk/v1/domain/refund_output.rb

Instance Attribute Summary collapse

Attributes inherited from OrderOutput

#amount_of_money, #references

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#amount_paidInteger



26
27
28
# File 'lib/worldline/connect/sdk/v1/domain/refund_output.rb', line 26

def amount_paid
  @amount_paid
end

#bank_refund_method_specific_outputWorldline::Connect::SDK::V1::Domain::RefundBankMethodSpecificOutput



26
27
28
# File 'lib/worldline/connect/sdk/v1/domain/refund_output.rb', line 26

def bank_refund_method_specific_output
  @bank_refund_method_specific_output
end

#card_refund_method_specific_outputWorldline::Connect::SDK::V1::Domain::RefundCardMethodSpecificOutput



26
27
28
# File 'lib/worldline/connect/sdk/v1/domain/refund_output.rb', line 26

def card_refund_method_specific_output
  @card_refund_method_specific_output
end

#cash_refund_method_specific_outputWorldline::Connect::SDK::V1::Domain::RefundCashMethodSpecificOutput



26
27
28
# File 'lib/worldline/connect/sdk/v1/domain/refund_output.rb', line 26

def cash_refund_method_specific_output
  @cash_refund_method_specific_output
end

#e_invoice_refund_method_specific_outputWorldline::Connect::SDK::V1::Domain::RefundEInvoiceMethodSpecificOutput



26
27
28
# File 'lib/worldline/connect/sdk/v1/domain/refund_output.rb', line 26

def e_invoice_refund_method_specific_output
  @e_invoice_refund_method_specific_output
end

#e_wallet_refund_method_specific_outputWorldline::Connect::SDK::V1::Domain::RefundEWalletMethodSpecificOutput



26
27
28
# File 'lib/worldline/connect/sdk/v1/domain/refund_output.rb', line 26

def e_wallet_refund_method_specific_output
  @e_wallet_refund_method_specific_output
end

#mobile_refund_method_specific_outputWorldline::Connect::SDK::V1::Domain::RefundMobileMethodSpecificOutput



26
27
28
# File 'lib/worldline/connect/sdk/v1/domain/refund_output.rb', line 26

def mobile_refund_method_specific_output
  @mobile_refund_method_specific_output
end

#payment_methodString



26
27
28
# File 'lib/worldline/connect/sdk/v1/domain/refund_output.rb', line 26

def payment_method
  @payment_method
end

Instance Method Details

#from_hash(hash) ⇒ Object



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
90
# File 'lib/worldline/connect/sdk/v1/domain/refund_output.rb', line 58

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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::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 = Worldline::Connect::SDK::V1::Domain::RefundMobileMethodSpecificOutput.new_from_hash(hash['mobileRefundMethodSpecificOutput'])
  end
  if hash.has_key? 'paymentMethod'
    @payment_method = hash['paymentMethod']
  end
end

#to_hHash



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

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