Git Product home page Git Product logo

choetl.nacha's Introduction

github

Cinchoo ETL - NACHA Library

.NET Library of NACHA file structure

This simple, nifty library exposes the .NET classes to read and process the NACHA files. These classes can be used in conjuction with Cinchoo ETL to read and generate ACH files easily.

Install

To install Cinchoo ETL - NACHA Library, run the following command in the Package Manager Console

.NET Framework NuGet
PM> Install-Package ChoETL.NACHA
.NET Core NuGet
PM> Install-Package ChoETL.NACHA.NETStandard

Add namespace to the program

using ChoETL.NACHA;

How to use

To read NACHA file (using c# 7, otherwise use if-else statement)

foreach (var r in new ChoNACHAReader("20151027B0000327P018CHK.ACH"))
{
    switch (r)
    {
        case ChoNACHAFileHeaderRecord fileHeaderRecord:
            Console.WriteLine(fileHeaderRecord.ImmediateOrigin);
            break;
        case ChoNACHAFileControlRecord fileControlRecord:
            Console.WriteLine(fileControlRecord.BatchCount);
            break;
        case ChoNACHABatchHeaderRecord batchHeaderRecord:
            Console.WriteLine(batchHeaderRecord.BatchNumber);
            break;
        case ChoNACHABatchControlRecord batchControlRecord:
            Console.WriteLine(batchControlRecord.BatchNumber);
            break;
        case ChoNACHAEntryDetailRecord entryDetailRecord:
            Console.WriteLine(entryDetailRecord.DFIAccountNumber);
            break;
    }
}

To write NACHA file

ChoNACHAConfiguration config = new ChoNACHAConfiguration();
config.DestinationBankRoutingNumber = "123456789";
config.OriginatingCompanyId = "123456789";
config.DestinationBankName = "PNC Bank";
config.OriginatingCompanyName = "Microsoft Inc.";
config.ReferenceCode = "Internal Use Only.";
config.BlockCount = 10;
using (var nachaWriter = new ChoNACHAWriter("ACH.txt", config))
{
	using (var bw1 = nachaWriter.CreateBatch(200))
	{
		using (var entry1 = bw1.CreateDebitEntryDetail(20, "123456789", "1313131313", 22.505M, "ID Number", "ID Name", "Desc Data"))
		{
			entry1.CreateAddendaRecord("Monthly bill");
		}
		using (var entry2 = bw1.CreateCreditEntryDetail(20, "123456789", "1313131313", 22.505M, "ID Number", "ID Name", "Desc Data"))
		{

		}
	}
	using (var bw2 = nachaWriter.CreateBatch(200))
	{
	}
}

If this project help you reduce time to develop, you can give me a cup of coffee :)

paypal

choetl.nacha's People

Contributors

cinchoo avatar ahoapap avatar ok10d avatar ssherwood0627 avatar wrakocy avatar jtone123 avatar drmcclelland 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.