NAME

ACH::Builder - Tools for Building ACH (Automated Clearing House) Files

SYNOPSIS

use ACH::Builder;

my $ach = ACH::Builder->new( {

    # (required) Company Identification, Fed Tax ID
    company_id        => '11-111111',

    # (required) This will appear on the receiver's bank statement
    company_name      => 'MY COMPANY',

    # (required) a brief description of the nature of the
    # payments this will apper on the receiver's bank statement
    entry_description => 'TV-TELCOM',

    # (required)
    destination       => '123123123',
    destination_name  => 'COMMERCE BANK',

    # (required)
    origination            => '12312311',
    origination_name       => 'MYCOMPANY',

    # (optional)
    company_note      => 'BILL',

    # (optional)
    effective_date    => 'yymmdd',

} );

# I've included some sample detail records
my @samples = $ach->sample_detail_records();

# build file header record
$ach->make_file_header_record();

# build batch for web entries
$ach->set_entry_class_code( 'WEB' );
$ach->make_batch( \@samples );

# build batch for telephone entries
$ach->set_entry_class_code( 'TEL' );
$ach->make_batch( \@samples );

# build file control record
$ach->make_file_control_record();

print $ach->to_string;

DESCRIPTION

ACH File Structure

This module is tool to help construct ACH files, which are fixed width formatted files accpected by most banks. ACH (Automated Clearing House) is an electronic banking network operating system in the United States. ACH processes large volumes of both credit and debit transactions which are originated in batches. Rules and regulations governing the ACH network are established by the National Automated Clearing House Association (NACHA) and the Federal Reserve (Fed).

ACH credit transfers include direct deposit payroll payments and payments to contractors and vendors. ACH debit transfers include consumer payments on insurance premiums, mortgage loans, and other kinds of bills.

DETAIL RECORD FORMAT

Detail Record Format

    { customer_name    => 'JOHN SMITH',
      customer_acct    => '0000-0111111',
      amount           => '2501',
      routing_number   => '010010101'
      bank_account     => '103030030' }

METHODS

new (constructor)

params: Hash Ref { company_id => '...', company_note ... }

** set methods are also provided for these parameters

    service_class_code
    destination_name
    origination_name
    destination
    origination
    entry_class_code
    entry_description
    company_id
    company_name
    company_note
    file_id_modifier
    record_size
    blocking_factor
    format_code
make_file_header_record

Called to create the File Header record. This should be called before "make_batch".

make_file_control_record

Called to create the File Control Record. This should be called after "make_batch".

make_batch

params: AoH Records

Called the create and stash a batch of ACH entries. This method requires an AoH records. See "sample_detail_records" from record specifications.

format_rules

Hash of ACH format rules.

sample_detail_records

AoH of sample detail records

Detail Record Format

    { customer_name    => 'JOHN SMITH',
      customer_acct    => '0000-0111111',
      amount           => '2501',
      routing_number   => '010010101'
      bank_account     => '103030030' }
to_string

returns the built ACH file

METHOD Setters

set_service_class_code
set_destination_name
set_destination
set_origination_name
set_origination
set_entry_class_code
set_entry_description
set_company_id
set_company_name
set_company_note
set_file_id_modifier
set_record_size
set_format_code

NOTES

ACH File structure.

File Header
  Batch Header
    Entries
  Batch Control
  Batch Header
    Entries
  Batch Control
 File Control

LIMITATIONS

Only supports the ACH format.

AUTHOR

Tim Keefer <tkeefer@gmail.com>

CONTRIBUTOR

Cameron Baustian <cameronbaustian@gmail.com>

COPYRIGHT

Tim Keefer

Cameron Baustian