Method: Cmxl::Fields::Transaction#to_h

Defined in:
lib/cmxl/fields/transaction.rb

#to_hObject



165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'lib/cmxl/fields/transaction.rb', line 165

def to_h
  {
    'sha' => sha,
    'date' => date,
    'entry_date' => ,
    'amount' => amount,
    'amount_in_cents' => amount_in_cents,
    'sign' => sign,
    'debit' => debit?,
    'credit' => credit?,
    'storno' => reversal?,
    'reversal' => reversal?,
    'expected' => expected?,
    'funds_code' => credit_debit_indicator,
    'credit_debit_indicator' => credit_debit_indicator,
    'swift_code' => swift_code,
    'reference' => reference,
    'bank_reference' => bank_reference,
    'currency_letter' => currency_letter
  }.tap do |h|
    h.merge!(details.to_h) if details
    h.merge!(supplementary.to_h) if supplementary.source
  end
end