Giter Club home page Giter Club logo

nacha-generator's Introduction

Build Status

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 support added 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.

nacha-generator's People

Contributors

philipwhitt avatar cwoskoski avatar sheppardv avatar datasage avatar mickeyschwab avatar ryanaip avatar vinceg avatar oh4real avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.