001/*
002 * jPOS Project [http://jpos.org]
003 * Copyright (C) 2000-2026 jPOS Software SRL
004 *
005 * This program is free software: you can redistribute it and/or modify
006 * it under the terms of the GNU Affero General Public License as
007 * published by the Free Software Foundation, either version 3 of the
008 * License, or (at your option) any later version.
009 *
010 * This program is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
013 * GNU Affero General Public License for more details.
014 *
015 * You should have received a copy of the GNU Affero General Public License
016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
017 */
018
019package org.jpos.iso.packager;
020
021import org.jpos.iso.*;
022
023/**
024 * ISO 8583 v1993 Binary Packager<br>
025 * <b>WARNING UNTESTED</b>
026 *
027 * @author <a href="mailto:u_arunkumar@yahoo.com">Arun Kumar U</a>
028 * @author <a href="mailto:apr@cs.com.uy">Alejandro P. Revilla</a>
029 * @version $Id$
030 * @see ISOPackager
031 * @see ISOBasePackager
032 * @see ISOComponent
033 */
034public class ISO93BPackager extends ISOBasePackager {
035    private static final boolean pad = false;
036    /** Array of field packagers indexed by field number. */
037    protected ISOFieldPackager fld[] = {
038    /*000*/ new IFB_NUMERIC (  4, "Message Type Indicator", pad),
039    /*001*/ new IFB_BITMAP  ( 16, "Bitmap"),
040    /*002*/ new IFB_LLNUM   ( 19, "Primary Account number", pad),
041    /*003*/ new IFB_NUMERIC (  6, "Processing Code", pad),
042    /*004*/ new IFB_NUMERIC ( 12, "Amount, Transaction", pad),
043    /*005*/ new IFB_NUMERIC ( 12, "Amount, Reconciliation", pad),
044    /*006*/ new IFB_NUMERIC ( 12, "Amount, Cardholder billing", pad),
045    /*007*/ new IFB_NUMERIC ( 10, "Date and time, transmission", pad),
046    /*008*/ new IFB_NUMERIC (  8, "Amount, Cardholder billing fee", pad),
047    /*009*/ new IFB_NUMERIC (  8, "Conversion rate, Reconciliation", pad),
048    /*010*/ new IFB_NUMERIC (  8, "Conversion rate, Cardholder billing", pad),
049    /*011*/ new IFB_NUMERIC (  6, "Systems trace audit number", pad),
050    /*012*/ new IFB_NUMERIC ( 12, "Date and time, Local transaction", pad),
051    /*013*/ new IFB_NUMERIC (  4, "Date, Effective", pad),
052    /*014*/ new IFB_NUMERIC (  4, "Date, Expiration", pad),
053    /*015*/ new IFB_NUMERIC (  6, "Date, Settlement", pad),
054    /*016*/ new IFB_NUMERIC (  4, "Date, Conversion", pad),
055    /*017*/ new IFB_NUMERIC (  4, "Date, Capture", pad),
056    /*018*/ new IFB_NUMERIC (  4, "Merchant type", pad),
057    /*019*/ new IFB_NUMERIC (  3, "Country code, Acquiring institution", pad),
058    /*020*/ new IFB_NUMERIC (  3, "Country code, Primary account number", pad),
059    /*021*/ new IFB_NUMERIC (  3, "Country code, Forwarding institution", pad),
060    /*022*/ new IF_CHAR     ( 12, "Point of service data code"),
061    /*023*/ new IFB_NUMERIC (  3, "Card sequence number", pad),
062    /*024*/ new IFB_NUMERIC (  3, "Function code", pad),
063    /*025*/ new IFB_NUMERIC (  4, "Message reason code", pad),
064    /*026*/ new IFB_NUMERIC (  4, "Card acceptor business code", pad),
065    /*027*/ new IFB_NUMERIC (  1, "Approval code length", pad),
066    /*028*/ new IFB_NUMERIC (  6, "Date, Reconciliation", pad),
067    /*029*/ new IFB_NUMERIC (  3, "Reconciliation indicator", pad),
068    /*030*/ new IFB_NUMERIC ( 24, "Amounts, original", pad),
069    /*031*/ new IFB_LLCHAR  ( 99, "Acquirer reference data"),
070    /*032*/ new IFB_LLNUM   ( 11, "Acquirer institution ident code", pad),
071    /*033*/ new IFB_LLNUM   ( 11, "Forwarding institution ident code", pad),
072    /*034*/ new IFB_LLCHAR  ( 28, "Primary account number, extended"),
073    /*035*/ new IFB_LLCHAR  ( 37, "Track 2 data"),
074    /*036*/ new IFB_LLLCHAR (104, "Track 3 data"),
075    /*037*/ new IF_CHAR     ( 12, "Retrieval reference number"),
076    /*038*/ new IF_CHAR     (  6, "Approval code"),
077    /*039*/ new IFB_NUMERIC (  3, "Action code", pad),
078    /*040*/ new IFB_NUMERIC (  3, "Service code", pad),
079    /*041*/ new IF_CHAR     (  8, "Card acceptor terminal identification"),
080    /*042*/ new IF_CHAR     ( 15, "Card acceptor identification code"),
081    /*043*/ new IFB_LLCHAR  ( 99, "Card acceptor name/location"),
082    /*044*/ new IFB_LLCHAR  ( 99, "Additional response data"),
083    /*045*/ new IFB_LLCHAR  ( 76, "Track 1 data"),
084    /*046*/ new IFB_LLLCHAR (204, "Amounts, Fees"),
085    /*047*/ new IFB_LLLCHAR (999, "Additional data - national"),
086    /*048*/ new IFB_LLLCHAR (999, "Additional data - private"),
087    /*049*/ new IF_CHAR     (  3, "Currency code, Transaction"),
088    /*050*/ new IF_CHAR     (  3, "Currency code, Reconciliation"),
089    /*051*/ new IF_CHAR     (  3, "Currency code, Cardholder billing"),
090    /*052*/ new IFB_BINARY  (  8, "Personal identification number (PIN) data"),
091    /*053*/ new IFB_LLBINARY( 48, "Security related control information"),
092    /*054*/ new IFB_LLLCHAR (120, "Amounts, additional"),
093    /*055*/ new IFB_LLLBINARY(255,"IC card system related data"),
094    /*056*/ new IFB_LLNUM   ( 35, "Original data elements", pad),
095    /*057*/ new IFB_NUMERIC (  3, "Authorization life cycle code", pad),
096    /*058*/ new IFB_LLNUM   ( 11, "Authorizing agent institution Id Code", pad),
097    /*059*/ new IFB_LLLCHAR (999, "Transport data"),
098    /*060*/ new IFB_LLLCHAR (999, "Reserved for national use"),
099    /*061*/ new IFB_LLLCHAR (999, "Reserved for national use"),
100    /*062*/ new IFB_LLLCHAR (999, "Reserved for private use"),
101    /*063*/ new IFB_LLLCHAR (999, "Reserved for private use"),
102    /*064*/ new IFB_BINARY  (  8, "Message authentication code field"),
103    /*065*/ new IFB_BINARY  (  8, "Reserved for ISO use"),
104    /*066*/ new IFB_LLLCHAR (204, "Amounts, original fees"),
105    /*067*/ new IFB_NUMERIC (  2, "Extended payment data", pad),
106    /*068*/ new IFB_NUMERIC (  3, "Country code, receiving institution", pad),
107    /*069*/ new IFB_NUMERIC (  3, "Country code, settlement institution", pad),
108    /*070*/ new IFB_NUMERIC (  3, "Country code, authorizing agent Inst.", pad),
109    /*071*/ new IFB_NUMERIC (  8, "Message number", pad),
110    /*072*/ new IFB_LLLCHAR (999, "Data record"),
111    /*073*/ new IFB_NUMERIC (  6, "Date, action", pad),
112    /*074*/ new IFB_NUMERIC ( 10, "Credits, number", pad),
113    /*075*/ new IFB_NUMERIC ( 10, "Credits, reversal number", pad),
114    /*076*/ new IFB_NUMERIC ( 10, "Debits, number", pad),
115    /*077*/ new IFB_NUMERIC ( 10, "Debits, reversal number", pad),
116    /*078*/ new IFB_NUMERIC ( 10, "Transfer, number", pad),
117    /*079*/ new IFB_NUMERIC ( 10, "Transfer, reversal number", pad),
118    /*080*/ new IFB_NUMERIC ( 10, "Inquiries, number", pad),
119    /*081*/ new IFB_NUMERIC ( 10, "Authorizations, number", pad),
120    /*082*/ new IFB_NUMERIC ( 10, "Inquiries, reversal number", pad),
121    /*083*/ new IFB_NUMERIC ( 10, "Payments, number", pad),
122    /*084*/ new IFB_NUMERIC ( 10, "Payments, reversal number", pad),
123    /*085*/ new IFB_NUMERIC ( 10, "Fee collections, number", pad),
124    /*086*/ new IFB_NUMERIC ( 16, "Credits, amount", pad),
125    /*087*/ new IFB_NUMERIC ( 16, "Credits, reversal amount", pad),
126    /*088*/ new IFB_NUMERIC ( 16, "Debits, amount", pad),
127    /*089*/ new IFB_NUMERIC ( 16, "Debits, reversal amount", pad),
128    /*090*/ new IFB_NUMERIC ( 10, "Authorizations, reversal number", pad),
129    /*091*/ new IFB_NUMERIC (  3, "Country code, transaction Dest. Inst.", pad),
130    /*092*/ new IFB_NUMERIC (  3, "Country code, transaction Orig. Inst.", pad),
131    /*093*/ new IFB_LLNUM   ( 11, "Transaction Dest. Inst. Id code", pad),
132    /*094*/ new IFB_LLNUM   ( 11, "Transaction Orig. Inst. Id code", pad),
133    /*095*/ new IFB_LLCHAR  ( 99, "Card issuer reference data"),
134    /*096*/ new IFB_LLLBINARY(999,"Key management data"),
135    /*097*/ new IFB_AMOUNT  (1+16,"Amount, Net reconciliation", pad),
136    /*098*/ new IF_CHAR     ( 25, "Payee"),
137    /*099*/ new IFB_LLCHAR  ( 11, "Settlement institution Id code"),
138    /*100*/ new IFB_LLNUM   ( 11, "Receiving institution Id code", pad),
139    /*101*/ new IFB_LLCHAR  ( 17, "File name"),
140    /*102*/ new IFB_LLCHAR  ( 28, "Account identification 1"),
141    /*103*/ new IFB_LLCHAR  ( 28, "Account identification 2"),
142    /*104*/ new IFB_LLLCHAR (100, "Transaction description"),
143    /*105*/ new IFB_NUMERIC ( 16, "Credits, Chargeback amount", pad),
144    /*106*/ new IFB_NUMERIC ( 16, "Debits, Chargeback amount", pad),
145    /*107*/ new IFB_NUMERIC ( 10, "Credits, Chargeback number", pad),
146    /*108*/ new IFB_NUMERIC ( 10, "Debits, Chargeback number", pad),
147    /*109*/ new IFB_LLCHAR  ( 84, "Credits, Fee amounts"),
148    /*110*/ new IFB_LLCHAR  ( 84, "Debits, Fee amounts"),
149    /*111*/ new IFB_LLLCHAR (999, "Reserved for ISO use"),
150    /*112*/ new IFB_LLLCHAR (999, "Reserved for ISO use"),
151    /*113*/ new IFB_LLLCHAR (999, "Reserved for ISO use"),
152    /*114*/ new IFB_LLLCHAR (999, "Reserved for ISO use"),
153    /*115*/ new IFB_LLLCHAR (999, "Reserved for ISO use"),
154    /*116*/ new IFB_LLLCHAR (999, "Reserved for national use"),
155    /*117*/ new IFB_LLLCHAR (999, "Reserved for national use"),
156    /*118*/ new IFB_LLLCHAR (999, "Reserved for national use"),
157    /*119*/ new IFB_LLLCHAR (999, "Reserved for national use"),
158    /*120*/ new IFB_LLLCHAR (999, "Reserved for national use"),
159    /*121*/ new IFB_LLLCHAR (999, "Reserved for national use"),
160    /*122*/ new IFB_LLLCHAR (999, "Reserved for national use"),
161    /*123*/ new IFB_LLLCHAR (999, "Reserved for private use"),
162    /*124*/ new IFB_LLLCHAR (999, "Reserved for private use"),
163    /*125*/ new IFB_LLLCHAR (999, "Reserved for private use"),
164    /*126*/ new IFB_LLLCHAR (999, "Reserved for private use"),
165    /*127*/ new IFB_LLLCHAR (999, "Reserved for private use"),
166    /*128*/ new IFB_BINARY  (  8, "Message authentication code field")
167    };
168    /** Default constructor. */
169    public ISO93BPackager() {
170        super();
171        setFieldPackager(fld);
172    }
173}