nacha / file-generator
Easy to use NACHA file generation for PPD/CCD transactions. Modeled using NACHA documentation.
Installs: 232 299
Dependents: 0
Suggesters: 0
Security: 0
Stars: 22
Watchers: 10
Forks: 18
Open Issues: 1
Requires (Dev)
- phpunit/phpunit: 4.5.*
README
NACHA File Generator
Based on documentation from NACHA: https://www.nacha.org/system/files/resources/AAP201%20-%20ACH%20File%20Formatting.pdf
Install With Composer
{
"require" : {
"nacha/file-generator" : "1.9.*"
}
}
Usage
<?php use Nacha\File; use Nacha\Batch; use Nacha\Record\DebitEntry; use Nacha\Record\CcdEntry; // Create the file and set the proper header info $file = new File(); $file->setImmediateDestination('051000033') ... ->setReferenceCode('MYCODE'); // Create a batch and add some entries $batch = new Batch(); $batch->getHeader() ... ->setOriginatingDFiId('01021234'); $batch->addDebitEntry((new DebitEntry) ... ->setTraceNumber('99936340', 1)); $file->addBatch($batch); // completed file ready for output $output = (string)$file;
For complete examples see test/Nacha/FileTest.php
Tests
$ ./vendor/bin/phpunit -c test/ci.xml
Todos
There is limited validation for field inputs. Strings that are too long will be truncated. Required/mandatory fields are currently not enforced.
Other missing elements:
Addenda supportadded in v1.9+- BOC, ARC, POP Entry records
- Corporate Trade Exchange Entries
- Point of Sale Entries
- Notification of Change Entry (COR)
- Return entries
Support for the above elements should be rather easy to implement, as the models were built with them in mind. Put in a pull request if you have an immediate need for one of the above features.