Home

chrisdebruin edited this page Aug 24, 2012 · 4 revisions
Clone this wiki locally

The clieop gem helps you to write correct CLIEOP03 files that can be submitted to Dutch banks.

Run gem install clieop -s http://gemcutter.org to install.

Sample usage

The following code list creates a CLIEOP file with one batch that holds two direct debt transactions:

clieop_file = Clieop::Payment::File.new
clieop_file.invoice_batch(:description => 'blah', 
          :account_nr => 123, :account_owner => 'me') do |batch|

  batch << { :account_nr => 123456, :account_owner => 'you', :amount => 133.0, 
         :description => "Testing a direct debt transaction\nCharging your bank account" }

  batch << { :account_nr => 654321, :account_owner => 'somebody else', :amount => 233.0,
         :description => 'Some description for the other guy' }
end

puts clieop_file.to_clieop       # output to string
clieop_file.save('CLIEOP03.000') # output to file

Classes

CLIEOP files are basically text files, in which every line is a record that has fields on fixed positions.

  • Clieop::Payment::File represents a complete CLIEOP file, which contains one or more batches.
  • Clieop::Payment::Batch represents a batch within a CLIEOP file. A batch can either be a payment batch or an invoice batch (direct debt) and contains multiple transactions. These transactions consists of records.
  • Clieop::Payment::Record represents a line or record in the CLIEOP file, the building block of transactions, batches and files. A record has a type, and every record type defines what fields occur on what fixed place in the line.