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_capture_requestedInteger

Returns the current value of amount_capture_requested.

Returns:

  • (Integer)

    the current value of amount_capture_requested



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

def amount_capture_requested
  @amount_capture_requested
end

#amount_capturedInteger

Returns the current value of amount_captured.

Returns:

  • (Integer)

    the current value of amount_captured



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

def amount_captured
  @amount_captured
end

#amount_paidInteger

Returns the current value of amount_paid.

Returns:

  • (Integer)

    the current value of amount_paid



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

def amount_paid
  @amount_paid
end

#amount_refund_requestedInteger

Returns the current value of amount_refund_requested.

Returns:

  • (Integer)

    the current value of amount_refund_requested



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

def amount_refund_requested
  @amount_refund_requested
end

#amount_refundedInteger

Returns the current value of amount_refunded.

Returns:

  • (Integer)

    the current value of amount_refunded



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

def amount_refunded
  @amount_refunded
end

#amount_reversedInteger

Returns the current value of amount_reversed.

Returns:

  • (Integer)

    the current value of amount_reversed



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

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:



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

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:



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

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:



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

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:



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

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:



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

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:



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

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:



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

def mobile_payment_method_specific_output
  @mobile_payment_method_specific_output
end

#operationsArray<Worldline::Connect::SDK::V1::Domain::PaymentOperation>

Returns the current value of operations.

Returns:



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

def operations
  @operations
end

#payment_methodString

Returns the current value of payment_method.

Returns:

  • (String)

    the current value of payment_method



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

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:



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

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



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

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:



40
41
42
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 40

def sepa_direct_debit_payment_method_specific_output
  @sepa_direct_debit_payment_method_specific_output
end

Instance Method Details

#from_hash(hash) ⇒ Object



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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 102

def from_hash(hash)
  super
  if hash.has_key? 'amountCaptureRequested'
    @amount_capture_requested = hash['amountCaptureRequested']
  end
  if hash.has_key? 'amountCaptured'
    @amount_captured = hash['amountCaptured']
  end
  if hash.has_key? 'amountPaid'
    @amount_paid = hash['amountPaid']
  end
  if hash.has_key? 'amountRefundRequested'
    @amount_refund_requested = hash['amountRefundRequested']
  end
  if hash.has_key? 'amountRefunded'
    @amount_refunded = hash['amountRefunded']
  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? 'operations'
    raise TypeError, "value '%s' is not an Array" % [hash['operations']] unless hash['operations'].is_a? Array
    @operations = []
    hash['operations'].each do |e|
      @operations << Worldline::Connect::SDK::V1::Domain::PaymentOperation.new_from_hash(e)
    end
  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)


79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/worldline/connect/sdk/v1/domain/payment_output.rb', line 79

def to_h
  hash = super
  hash['amountCaptureRequested'] = @amount_capture_requested unless @amount_capture_requested.nil?
  hash['amountCaptured'] = @amount_captured unless @amount_captured.nil?
  hash['amountPaid'] = @amount_paid unless @amount_paid.nil?
  hash['amountRefundRequested'] = @amount_refund_requested unless @amount_refund_requested.nil?
  hash['amountRefunded'] = @amount_refunded unless @amount_refunded.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['operations'] = @operations.collect{|val| val.to_h} unless @operations.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