Class: Worldline::Connect::SDK::V1::Domain::PaymentOutput

Inherits:
OrderOutput show all
Defined in:
lib/worldline/connect/sdk/v1/domain/payment_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

Returns the current value of amount_paid.

Returns:

  • (Integer)

    the current value of amount_paid



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def amount_paid
  @amount_paid
end

#amount_reversedInteger

Returns the current value of amount_reversed.

Returns:

  • (Integer)

    the current value of amount_reversed



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def amount_reversed
  @amount_reversed
end

#bank_transfer_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::BankTransferPaymentMethodSpecificOutput

Returns the current value of bank_transfer_payment_method_specific_output.

Returns:



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def bank_transfer_payment_method_specific_output
  @bank_transfer_payment_method_specific_output
end

#card_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::CardPaymentMethodSpecificOutput

Returns the current value of card_payment_method_specific_output.

Returns:



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def card_payment_method_specific_output
  @card_payment_method_specific_output
end

#cash_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::CashPaymentMethodSpecificOutput

Returns the current value of cash_payment_method_specific_output.

Returns:



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def cash_payment_method_specific_output
  @cash_payment_method_specific_output
end

#direct_debit_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::NonSepaDirectDebitPaymentMethodSpecificOutput

Returns the current value of direct_debit_payment_method_specific_output.

Returns:



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def direct_debit_payment_method_specific_output
  @direct_debit_payment_method_specific_output
end

#e_invoice_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::EInvoicePaymentMethodSpecificOutput

Returns the current value of e_invoice_payment_method_specific_output.

Returns:



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def e_invoice_payment_method_specific_output
  @e_invoice_payment_method_specific_output
end

#invoice_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::InvoicePaymentMethodSpecificOutput

Returns the current value of invoice_payment_method_specific_output.

Returns:



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def invoice_payment_method_specific_output
  @invoice_payment_method_specific_output
end

#mobile_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::MobilePaymentMethodSpecificOutput

Returns the current value of mobile_payment_method_specific_output.

Returns:



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def mobile_payment_method_specific_output
  @mobile_payment_method_specific_output
end

#payment_methodString

Returns the current value of payment_method.

Returns:

  • (String)

    the current value of payment_method



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def payment_method
  @payment_method
end

#redirect_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::RedirectPaymentMethodSpecificOutput

Returns the current value of redirect_payment_method_specific_output.

Returns:



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def redirect_payment_method_specific_output
  @redirect_payment_method_specific_output
end

#reversal_reasonString

Returns the current value of reversal_reason.

Returns:

  • (String)

    the current value of reversal_reason



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def reversal_reason
  @reversal_reason
end

#sepa_direct_debit_payment_method_specific_outputWorldline::Connect::SDK::V1::Domain::SepaDirectDebitPaymentMethodSpecificOutput

Returns the current value of sepa_direct_debit_payment_method_specific_output.

Returns:



34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 34

def sepa_direct_debit_payment_method_specific_output
  @sepa_direct_debit_payment_method_specific_output
end

Instance Method Details

#from_hash(hash) ⇒ Object



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 81

def from_hash(hash)
  super
  if hash.has_key? 'amountPaid'
    @amount_paid = hash['amountPaid']
  end
  if hash.has_key? 'amountReversed'
    @amount_reversed = hash['amountReversed']
  end
  if hash.has_key? 'bankTransferPaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['bankTransferPaymentMethodSpecificOutput']] unless hash['bankTransferPaymentMethodSpecificOutput'].is_a? Hash
    @bank_transfer_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::BankTransferPaymentMethodSpecificOutput.new_from_hash(hash['bankTransferPaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'cardPaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cardPaymentMethodSpecificOutput']] unless hash['cardPaymentMethodSpecificOutput'].is_a? Hash
    @card_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::CardPaymentMethodSpecificOutput.new_from_hash(hash['cardPaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'cashPaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['cashPaymentMethodSpecificOutput']] unless hash['cashPaymentMethodSpecificOutput'].is_a? Hash
    @cash_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::CashPaymentMethodSpecificOutput.new_from_hash(hash['cashPaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'directDebitPaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['directDebitPaymentMethodSpecificOutput']] unless hash['directDebitPaymentMethodSpecificOutput'].is_a? Hash
    @direct_debit_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::NonSepaDirectDebitPaymentMethodSpecificOutput.new_from_hash(hash['directDebitPaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'eInvoicePaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['eInvoicePaymentMethodSpecificOutput']] unless hash['eInvoicePaymentMethodSpecificOutput'].is_a? Hash
    @e_invoice_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::EInvoicePaymentMethodSpecificOutput.new_from_hash(hash['eInvoicePaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'invoicePaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['invoicePaymentMethodSpecificOutput']] unless hash['invoicePaymentMethodSpecificOutput'].is_a? Hash
    @invoice_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::InvoicePaymentMethodSpecificOutput.new_from_hash(hash['invoicePaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'mobilePaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['mobilePaymentMethodSpecificOutput']] unless hash['mobilePaymentMethodSpecificOutput'].is_a? Hash
    @mobile_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::MobilePaymentMethodSpecificOutput.new_from_hash(hash['mobilePaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'paymentMethod'
    @payment_method = hash['paymentMethod']
  end
  if hash.has_key? 'redirectPaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['redirectPaymentMethodSpecificOutput']] unless hash['redirectPaymentMethodSpecificOutput'].is_a? Hash
    @redirect_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::RedirectPaymentMethodSpecificOutput.new_from_hash(hash['redirectPaymentMethodSpecificOutput'])
  end
  if hash.has_key? 'reversalReason'
    @reversal_reason = hash['reversalReason']
  end
  if hash.has_key? 'sepaDirectDebitPaymentMethodSpecificOutput'
    raise TypeError, "value '%s' is not a Hash" % [hash['sepaDirectDebitPaymentMethodSpecificOutput']] unless hash['sepaDirectDebitPaymentMethodSpecificOutput'].is_a? Hash
    @sepa_direct_debit_payment_method_specific_output = Worldline::Connect::SDK::V1::Domain::SepaDirectDebitPaymentMethodSpecificOutput.new_from_hash(hash['sepaDirectDebitPaymentMethodSpecificOutput'])
  end
end

#to_hHash

Returns:

  • (Hash)


63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 63

def to_h
  hash = super
  hash['amountPaid'] = @amount_paid unless @amount_paid.nil?
  hash['amountReversed'] = @amount_reversed unless @amount_reversed.nil?
  hash['bankTransferPaymentMethodSpecificOutput'] = @bank_transfer_payment_method_specific_output.to_h unless @bank_transfer_payment_method_specific_output.nil?
  hash['cardPaymentMethodSpecificOutput'] = @card_payment_method_specific_output.to_h unless @card_payment_method_specific_output.nil?
  hash['cashPaymentMethodSpecificOutput'] = @cash_payment_method_specific_output.to_h unless @cash_payment_method_specific_output.nil?
  hash['directDebitPaymentMethodSpecificOutput'] = @direct_debit_payment_method_specific_output.to_h unless @direct_debit_payment_method_specific_output.nil?
  hash['eInvoicePaymentMethodSpecificOutput'] = @e_invoice_payment_method_specific_output.to_h unless @e_invoice_payment_method_specific_output.nil?
  hash['invoicePaymentMethodSpecificOutput'] = @invoice_payment_method_specific_output.to_h unless @invoice_payment_method_specific_output.nil?
  hash['mobilePaymentMethodSpecificOutput'] = @mobile_payment_method_specific_output.to_h unless @mobile_payment_method_specific_output.nil?
  hash['paymentMethod'] = @payment_method unless @payment_method.nil?
  hash['redirectPaymentMethodSpecificOutput'] = @redirect_payment_method_specific_output.to_h unless @redirect_payment_method_specific_output.nil?
  hash['reversalReason'] = @reversal_reason unless @reversal_reason.nil?
  hash['sepaDirectDebitPaymentMethodSpecificOutput'] = @sepa_direct_debit_payment_method_specific_output.to_h unless @sepa_direct_debit_payment_method_specific_output.nil?
  hash
end