iso8583

package module
v0.0.0-...-c6312c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

README

Installation

$ go get -u github.com/bvnk/iso8583

example

package main

import "github.com/bvnk/iso8583"

func main() {

}

Documentation

Index

Constants

View Source
const (

	// authorization messages
	//An authorization is an approval or guarantee of funds given by the card issuer to the acquirer.
	//The acquirer seeks authorization from the card issuer or advises the card issuer of authorization already given,
	//by means of the authorization message class. An authorization is not intended to permit the application
	//of the approved transaction amount to the cardholder's account for billing or posting.
	AUTH_REQ           = "100" // authorization request
	AUTH_REQ_REPEAT    = "101" // authorization request repeat
	AUTH_REQ_RESP      = "110" // authorization request response
	AUTH_ADVICE        = "120" // authorization advice
	AUTH_ADVICE_REPEAT = "121" // authorization advice repeat
	AUTH_ADVICE_RESP   = "130" // authorization advice response
	AUTH_NOTIFY        = "140" // authorization notification
	AUTH_NOTIFY_RESP   = "150" // authorization notification response

	// verification messages
	//Verification messages may be used to request verification or authentication.
	//This message class may be used for authentication of certificates, certificate management,
	//address verification, cash transactions, cheque verification or any other transactions that
	//do not require a subsequent financial presentment message to complete the transaction.
	VERIF_REQ           = "104" // verification request
	VERIF_REQ_REPEAT    = "105" // verification request repeat
	VERIF_REQ_RESP      = "114" // verification request response
	VERIF_ADVICE        = "124" // verification advice
	VERIF_ADVICE_REPEAT = "125" // verification advice repeat
	VERIF_ADVICE_RESP   = "134" // verification advice response
	VERIF_NOTIFY        = "144" // verification notification
	VERIF_NOTIFY_RESP   = "154" // verification notification response

	// financial messages
	FIN_REQ           = "200" // financial request
	FIN_REQ_REPEAT    = "201" // financial request repeat
	FIN_REQ_RESP      = "210" // financial request response
	FIN_ADVICE        = "220" // financial advice
	FIN_ADVICE_REPEAT = "221" // financial advice repeat
	FIN_ADVICE_RESP   = "230" // financial advice response
	FIN_NOTIFY        = "240" // financial notification
	FIN_NOTIFY_RESP   = "250" // financial notification response

	// file action messages
	FILE_ACTION_REQ           = "304" // file action request
	FILE_ACTION_REQ_REPEAT    = "305" // file action request repeat
	FILE_ACTION_REQ_RESP      = "314" // file action request response
	FILE_ACTION_ADVICE        = "324" // file action advice
	FILE_ACTION_ADVICE_REPEAT = "325" // file action advice repeat
	FILE_ACTION_ADVICE_RESP   = "334" // file action advice response
	FILE_ACTION_NOTIFY        = "344" // file action notification
	FILE_ACTION_NOTIFY_RESP   = "354" // file action notification response

	// reversal/chargeback messages
	REV_ADVICE           = "420" // reversal advice
	REV_ADVICE_REPEAT    = "421" // reversal advice repeat
	REV_ADVICE_RESP      = "430" // reversal advice response
	REV_ADVICE_NOTIFY    = "440" // reversal notification
	CHARGE_ADVICE        = "422" // chargeback advice
	CHARGE_ADVICE_REPEAT = "423" // chargeback advice repeat
	CHARGE_ADVICE_RESP   = "432" // chargeback advice response
	CHARGE_NOTIFY        = "442" // chargeback advice notification
	CHARGE_NOTIFY_RESP   = "452" // chargeback advice notification response

	// acquirer reconciliation messages
	ACQ_RECON_REQ           = "500" // acquirer reconciliation request
	ACQ_RECON_REQ_REPEAT    = "501" // acquirer reconciliation request repeat
	ACQ_RECON_REQ_RESP      = "510" // acquirer reconciliation request response
	ACQ_RECON_ADVICE        = "520" // acquirer reconciliation advice
	ACQ_RECON_ADVICE_REPEAT = "521" // acquirer reconciliation advice repeat
	ACQ_RECON_ADVICE_RESP   = "530" // acquirer reconciliation advice response
	ACQ_RECON_NOTIFY        = "540" // acquirer reconciliation notification
	ACQ_RECON_NOTIFY_RESP   = "550" // acquirer reconciliation notification response

	// issuer reconciliation messages
	ISSR_RECON_REQ           = "502" // issuer reconciliation request
	ISSR_RECON_REQ_REPEAT    = "503" // issuer reconciliation request repeat
	ISSR_RECON_REQ_RESP      = "512" // issuer reconciliation request response
	ISSR_RECON_ADVICE        = "522" // issuer reconciliation advice
	ISSR_RECON_ADVICE_REPEAT = "523" // issuer reconciliation advice repeat
	ISSR_RECON_ADVICE_RESP   = "532" // issuer reconciliation afvice response
	ISSR_RECON_NOTIFY        = "542" // issuer reconciliation notification
	ISSR_RECON_NOTIFY_RESP   = "552" // issuer reconciliation notification response

	// network administrative messages
	ADMIN_REQ        = "604" // network administrative request
	ADMIN_REQ_REPEAT = "605" // network administrative request repeat
	ADMIN_REQ_RESP   = "614" // network administrative request response

	ADMIN_ADVICE        = "624" // administrative advice
	ADMIN_ADVICE_REPEAT = "625" // administrative advice repeat
	ADMIN_ADVICE_RESP   = "634" // administrative advice response

	ADMIN_NOTIFY      = "644" // administrative notification
	ADMIN_NOTIFY_RESP = "654" // administrative notification response

	// fee collection messages
	ACQ_FEE_ADVICE        = "720" // acquirer fee collection advice
	ACQ_FEE_ADVICE_REPEAT = "721" // acquirer fee collection advice repeat
	ACQ_FEE_ADVICE_RESP   = "730" // acquirer fee collection advice response
	ACQ_FEE_NOTIFY        = "740" // acquirer fee collection notification
	ACQ_FEE_NOTIFY_RESP   = "750" // acquirer fee collection notification response

	ISSR_FEE_ADVICE        = "722" // issuer fee collection advice
	ISSR_FEE_ADVICE_REPEAT = "723" // issuer fee collection advice repeat
	ISSR_FEE_ADVICE_RESP   = "732" // issuer fee collection advice response
	ISSR_FEE_NOTIFY        = "742" // issuer fee collection notification
	ISSR_FEE_NOTIFY_RESP   = "752" // issuer fee collection notification response

	// network management messages
	NET_MGMT_REQ           = "804" // network management request
	NET_MGMT_REQ_REPEAT    = "805" // network management request repeat
	NET_MGMT_REQ_RESP      = "814" // network management request response
	NET_MGMT_ADVICE        = "824" // network management advice
	NET_NGMT_ADVICE_REPEAT = "825" // network management advice repeat
	NET_MGMT_ADVICE_RESP   = "834" // network management advice response
	NET_MGMT_NOTIFY        = "844" // network management notification
	NET_MGMT_NOTIFY_RESP   = "854" // network management notification resp

	//Authorization and transaction messages: 110,120,121,140 and 210,220,221 and 240
	//Meaning: indicate that the transaction has been approved
	RC_APPROVED              = "000" // approved
	RC_APPROVED_WITH_ID      = "001" // honor with identification
	RC_APPROVED_PARTIAL      = "002" // approved for partial amount
	RC_APPROVED_VIP          = "003" // approved(VIP)
	RC_APPROVED_TRACK3       = "004" // approved; update track 3
	RC_APPROVED_ACCT_SPEC    = "005" // approved, account type specified by card issuer
	RC_APPROVED_PARTIAL_SPEC = "006" // approved for partial amount; account type specified by card issuer
	RC_APPROVED_ICC          = "007" // approved, update ICC
	RC_APPROVED_NEED_CNFM    = "080" // approved, but need confirmation(used for CIBC and NOVA debit card processing mode

	//Authorization and transaction messages: 110,120,121,140 and 210,220,221 and 240
	//Meaning: indicate that the transaction has processed by or on behalf of issuer and denied (not requiring a card pick-up)
	RC_DECLINED_DO_NOT_HONOR         = "100" // do not honor
	RC_DECLINED_EXPIRED_CARD         = "101" // expired card
	RC_DECLINED_SUSPECTED            = "102" // suspected fraud
	RC_DECLINED_CONTACT_ACQ          = "103" // card acceptor contact acquirer
	RC_DECLINED_RESTRICTED           = "104" // restricted card
	RC_DECLINED_CALL_ACQ             = "105" // card acceptor call acquirer's security department
	RC_DECLINED_PIN_EXCEED           = "106" // allowable PIN tries exceeded
	RC_DECLINED_REFER_ISSR           = "107" // refer to card issuer
	RC_DECLINED_REFER_ISSR_COND      = "108" // refer to card issuer's special conditions
	RC_DECLINED_INVALID_MERCHANT     = "109" // invalid merchant
	RC_DECLINED_INVALID_AMOUNT       = "110" // invalid amount
	RC_DECLINED_INVALID_CARD         = "111" // invalid card number
	RC_DECLINED_PIN_REQUIRED         = "112" // PIN data required
	RC_DECLINED_UNACCEPT_FEE         = "113" // unacceptable fee
	RC_DECLINED_ACCT_REQ             = "114" // no account of type requested
	RC_DECLINED_FUNC_NOT_SUPPORT     = "115" // requested function not supported
	RC_DECLINED_NOT_SUFF_FUNDS       = "116" // not sufficient funds
	RC_DECLINED_INCORRECT_PIN        = "117" // incorrect PIN
	RC_DECLINED_NO_CARD_RECORD       = "118" // no card record
	RC_DECLINED_NOT_ALLOW_CARDHOLDER = "119" // transaction not permitted to cardholder

	RC_DECLINED_NOT_ALLOW_TERMINAL  = "120" // transaction not permitted to terminal
	RC_DECLINED_EXCEED_AMOUNT_LIMIT = "121" // exceeds withdrawal amount limit
	RC_DECLINED_VIOLATION           = "122" // security violation
	RC_DECLINED_EXCEED_FREQ_LIMIT   = "123" // exceeds withdrawal frequency limit
	RC_DECLINED_VIOLATION_LAW       = "124" // violation of law
	RC_DECLINED_NOT_EFFECTIVE       = "125" // card not effective
	RC_DECLINED_INVALID_PIN         = "126" // invalid PIN block
	RC_DECLINED_PIN_LENGTH          = "127" // PIN length error
	RC_DECLINED_PIN_SYNC            = "128" // PIN key synch error
	RC_DECLINED_SUSPECTED_COUNTER   = "129" // suspected counterfeit card

	//Authorization and transaction messages: 110,120,121,140 and 210,220,221 and 240
	//Meaning: indicate that the transaction has processed by or on behalf of issuer and denied (requiring a card to be pick-up.)
	RC_PICKUP_DO_NOT_HONOR      = "200" // do not honor
	RC_PICKUP_EXPIRED_CARD      = "201" // expired card
	RC_PICKUP_SUSPECTED         = "202" // suspected fraud
	RC_PICKUP_CONTACT_ACQ       = "203" // card acceptor contact acquirer
	RC_PICKUP_RESTRICTED        = "204" // restricted card
	RC_PICKUP_CALL_ACQ          = "205" // card acceptor call acquirer's security department
	RC_PICKUP_PIN_EXCEED        = "206" // allowable PIN tries exceeded
	RC_PICKUP_SPEC_COND         = "207" // special condition
	RC_PICKUP_LOST              = "208" // lost card
	RC_PICKUP_STOLEN            = "209" // stolen card
	RC_PICKUP_SUSPECTED_COUNTER = "210" // suspected countfeid card

	//File action messages: 314 324,325 and 344
	//Meaning: indicates result of file action
	RC_FILE_SUCCESS              = "300" // successful
	RC_FILE_NOT_SUPPORT          = "301" // not supported by receiver
	RC_FILE_UNABLE_LOCATE_RECORD = "302" // unable to locate record on file
	RC_FILE_DUP_REPLACE          = "303" // duplicate record; old record replaced
	RC_FILE_EDIT_ERROR           = "304" // field edit error
	RC_FILE_LOCKED_OUT           = "305" // file locked out
	RC_FILE_NOT_SUCCESS          = "306" // not successful
	RC_FILE_FORMAT_ERROR         = "307" // format error
	RC_FILE_DUP_REJECT           = "308" // duplicate; new record rejected
	RC_FILE_UNKNOWN              = "309" // unknown file

	//Reversal and chargeback messages: 430,432,440 and 442
	//Meaning: result of the reversal or chargeback.
	RC_REVERSAL_ACCEPT = "400" // accepted

	//Reconciliation messages: 510,512,530 and 532
	//Meaning: result of reconciliation
	RC_RECON_IN_BALANCE          = "500" // reconciled; in balance
	RC_RECON_OUT_BALANCE         = "501" // reconciled; out balance
	RC_RECON_AMOUNT_NOT_RECON    = "502" // amount not reconciled; total provided
	RC_RECON_TOTAL_NOT_AVAILABLE = "503" // totals not avalable
	RC_RECON_NOT_RECON           = "504" // not reconciled; totals provided

	//Adminitrative request messages: 614;624;625 and 644
	//Meaning: result of operation
	RC_ADMIN_ACCEPT              = "600" // accepted
	RC_ADMIN_NOT_TRACE_ORIGIN    = "601" // not able to trace back original transaction
	RC_ADMIN_INVALID_REFERENCE   = "602" // invalid reference number
	RC_ADMIN_PAN_INCOMPATIBLE    = "603" // reference number/PAN incompatible
	RC_ADMIN_PHOTO_NOT_AVAILABLE = "604" // POS photograph is not available
	RC_ADMIN_ITEM_SUPP           = "605" // item supplied
	RC_ADMIN_DOC_NOT_SUPP        = "606" // request cannot be fulfilled-required/requested documentation is not available

	//Fee collection messages: 720;721;740;722;723 and 742
	RC_FEE_ACCEPT = "700" // accepted

	//Network management messages:  814;824;825 and 844
	RC_NETWORK_ACCEPT       = "800" // accepted
	RC_NETWORK_NO_LIABILITY = "900" // advice acknowledged; no financial liability accepted
	RC_NETWORK_LIABILITY    = "901" // advice acknowledged; financial liability accepted

	//Transaction request and response messages
	//Meanint: indicate transaction could not be processed
	RC_REJECT_INVALID_TXN              = "902" // invalid transaction
	RC_REJECT_RE_ENTER_TXN             = "903" // re-enter transaction
	RC_REJECT_FORMAT_ERROR             = "904" // format error
	RC_REJECT_ACQ_NOT_SUPP             = "905" // acquirer not supported by switch
	RC_REJECT_CUTOVER_IN_PROCESS       = "906" // cutover in process
	RC_REJECT_ISSUER_INOPERATIVE       = "907" // card issuer or switch inoperative
	RC_REJECT_DEST_NOT_FOUND           = "908" // transaction destination cannot be found for routing
	RC_REJECT_SYSTEM_MALFUNCTION       = "909" // system malfunction
	RC_REJECT_ISSUER_SIGNOFF           = "910" // card issuer signed off
	RC_REJECT_ISSUER_TIMEOUT           = "911" // card issuer timed out
	RC_REJECT_ISSUER_NOT_AVAILABLE     = "912" // card issuer unavailable
	RC_REJECT_DUP_TRANSMISSION         = "913" // duplicate transmission
	RC_REJECT_NOT_TRACE_ORIGIN         = "914" // not able to trace back to original transaction
	RC_REJECT_CHECKPOINT_ERROR         = "915" // reconciliation cutover or checkpoint error
	RC_REJECT_MAC_ERROR                = "916" // MAC incorrect
	RC_REJECT_MAC_KEY_SYNC             = "917" // MAC key sync error
	RC_REJECT_NO_COMM_KEY              = "918" // no communication keys available for use
	RC_REJECT_ENCRYPTION_KEY_SYNC      = "919" // encryption key sync error
	RC_REJECT_SECURITY_ERROR_TRY_AGAIN = "920" // security software/hardware error - try again
	RC_REJECT_SECURITY_ERROR_NO_ACTION = "921" // security software/hardware error - no action
	RC_REJECT_MSGNO_ERROR              = "922" // message number out of sequence
	RC_REJECT_REQ_IN_PROCESS           = "923" // request in progress

	// 950-999 Used in advice response(xx3x) to indicate the reason for rejection of the transfer of financial liability.
	RC_REJECT_VIOLATION = "950" // violation of business arrangement

	// 100-199 Used in 100;101;120;121 and 140 messages
	FUNC_AUTH_ORIGAUTH_ACCUAMT = "100" // original authorization - amount accurate
	FUNC_AUTH_ORIGAUTH_ESTIAMT = "101" // original authorization - amount estimated
	FUNC_AUTH_REPLAUTH_ACCUAMT = "102" // replacement authorization - amount accurate
	FUNC_AUTH_REPLAUTH_ESTIAMT = "103" // replacement authorization - amount estimated
	FUNC_AUTH_RESUBM_ACCUAMT   = "104" // resubmission - amount accurate
	FUNC_AUTH_RESUBM_ESTIAMT   = "105" // resubmission - amount estimated
	FUNC_AUTH_SUPMAUTH_ACCUAMT = "106" // supplementary authorization - amount accurate
	FUNC_AUTH_SUPMAUTH_ESTIAMT = "107" // supplementary authorization - amount estimated
	FUNC_AUTH_INQUIRY          = "108" // inquiry

	// 200-299 Used in 1200;1201,1220,1221 and 1240 message
	FUNC_FIN_ORIGFIN_TXN         = "200" // original financial request/advice
	FUNC_FIN_PREVAUTH_SAMEAMT    = "201" // previously approved authorization - amount same
	FUNC_FIN_PREVAUTH_DIFFAMT    = "202" // previously approved authorization - amount differs
	FUNC_FIN_RESUB_PREVFIN_DENY  = "203" // resubmission of a previously denied financial request
	FUNC_FIN_RESUB_PREVFIN_REVER = "204" // resubmission of a previously reversed financial transaction
	FUNC_FIN_FIRST_REPRE         = "205" // first representment
	FUNC_FIN_SECOND_REPRE        = "206" // second representment
	FUNC_FIN_THIRD_REPRE         = "207" // third or subsequent representment

	// 300-399 Used in 1304,1305,1324,1325 and 1344 messages
	FUNC_FILE_UNASSI     = "300" // unassigned
	FUNC_FILE_ADD_RECORD = "301" // addd record
	FUNC_FILE_CHG_RECORD = "302" // change record
	FUNC_FLLE_DEL_RECORD = "303" // delete record
	FUNC_FILE_REP_RECORD = "304" // replace record
	FUNC_FILE_INQ        = "305" // inquiry
	FUNC_FILE_REP_FILE   = "306" // replace file
	FUNC_FILE_ADD_FILE   = "307" // add file
	FUNC_FILE_DEL_FILE   = "308" // delete file
	FUNC_FILE_CARD_ADMIN = "309" // card administration

	// 400-449 Used in 1420,1421 and 1440 messages to indicate the function of the reversal
	FUNC_REV_FULL = "400" // full reversal; transaction did not complete as approved
	FUNC_REV_PART = "401" // partial reversal; transaction did not complete for full amount

	// 450-499 Used in 1422,1423 and 1442 messages to indicate the function of the chargeback
	FUNC_CHARG_FIRST_FULL   = "450" // first chargeback; full
	FUNC_CHARG_SECOND_FULL  = "451" // second chargeback; full
	FUNC_CHARG_THIRD_FULL   = "452" // third or subsequent chargeback; full
	FUNC_CHARG_FIRST_PART   = "453" // first chargeback; partial
	FUNC_CHARGE_SECOND_PART = "454" // second chargeback; partial
	FUNC_CHARGE_THIRD_PART  = "455" // third or subsequent; partial

	// 500-599 Used in 1500,1501,1502,1503,1520,1521,1522,1523,1540 and 1542 messages
	FUNC_RECON_FINAL          = "500" // final reconciliation
	FUNC_RECON_CHK_POINT      = "501" // checkpoint reconciliation
	FUNC_RECON_FINAL_CURR     = "502" // final reconciliation in a specified currency
	FUNC_RECON_CHK_POINT_CURR = "503" // checkpoint reconciliation in a specified currency
	FUNC_RECON_REQ            = "504" // request for reconciliation totals
	FUNC_RECON_SETTLE         = "570" // request to settle
	// 600-649 Used in 1604,1605,1624,1625 and 1644 messages for retrievals.
	FUNC_ADMIN_ORIGRECP_RETRREQ        = "600" // original receipt, retrieval request
	FUNC_ADMIN_ORIGRECP_RETRREQ_REPEAT = "601" // original receipt, repeat retrieval request
	FUNC_ADMIN_ORIGRECP_FULFILL        = "602" // original receipt, fulfillment
	FUNC_ADMIN_COPY_RETRREQ            = "603" // copy, retrieval request
	FUNC_ADMIN_COPY_RETRREQ_REPEAT     = "604" // copy, repeat retrieval request
	FUNC_ADMIN_COPY_FULFILL            = "605" // copyn; fulfillment
	FUNC_ADMIN_VEHICLE                 = "606" // vehicle rental agreement
	FUNC_ADMIN_HOTEL                   = "607" // hotel charge detail
	FUNC_ADMIN_POS                     = "608" // POS photograph
	FUNC_ADMIN_DEVY                    = "609" // proof of delivery
	FUNC_ADMIN_IMPRINT                 = "610" // imprint

	// 650-699 Used in 604,605,624,625 and 644 messages for administrative messages.
	FUNC_ADMIN_NOT_PARSE = "650" // unable to parse message

	// 700-799 Used in 720,721,740,722,723 and 742 messages.
	FUNC_FEE_COLL        = "700" // fee collection message
	FUNC_FEE_COLL_CANCEL = "701" // fee collection cancellation, full/partial

	// 800-899 Used in 804,805,824,825 and 844 messages.
	FUNC_NETWORK_SIGNON  = "801" // system condition/sign-on
	FUNC_NETWORK_SIGNOFF = "802" // system condition/sign-off
	FUNC_NETWORK_UNAVAIL = "803" // system condition/target system unavailable
	FUNC_NETWORK_BACKUP  = "804" // system condition/message originator's system in backup
	FUNC_NETWORK_SPECIAL = "805" // system condition/special instruction
	FUNC_NETWORK_ROUTE   = "806" // system condition/initate alternate routing

	FUNC_NETWORK_KEYCHANGE    = "811" // system security/key change
	FUNC_NETWORK_ALERT        = "812" // system security/security alert
	FUNC_NETWORK_PASSWDCHANGE = "813" // system security/password change
	FUNC_NETWORK_DEVICE_AUTH  = "814" // system security/device authentication

	FUNC_NETWORK_CUTOVER   = "821" // system accounting/cutover
	FUNC_NETWORK_CHK_POINT = "822" // system accounting/checkpoint

	FUNC_NETWORK_ECHO = "831" // system audit control/echo test

	// ISO 8583(1993) amount type codes - field ... ...
	// 00-19 account related balances
	// 00 reserved for ISO use
	AMT_LEDGER_BALANCE = "01" // account ledger balance
	AMT_AVAIL_BALANCE  = "02" // account available balance
	AMT_OWING          = "03" // account owning
	AMT_DUE            = "04" // account due
	AMT_AVAIL_CREDIT   = "05" // account available credit
	// 20-39 card related amounts
	AMT_REMAINING = "20" // amount remaining this cycle
	// 40-59 transaction related amounts
	AMT_CASH  = "40" // amount cash
	AMT_GOODS = "41" // amount goods and services

	// 00-19 debits
	TPC_DB_GOODS_AND_SERVICE = "00" // goods and service
	TPC_DB_CASH              = "01" // cash
	TPC_DB_ADJUSTMENT        = "02" // adjustment
	TPC_DB_CHEQUE_GUAR       = "03" // cheque guarantee(funds guaranteed)
	TPC_DB_CHEQUE_VERI       = "04" // cheque verification(funds available but not quaranteed)
	TPC_DB_EURO_CHEQUE       = "05" // eurocheque
	TPC_DB_TRAVEL_CHEQUE     = "06" // traveller cheque
	TPC_DB_LETTER_CREDIT     = "07" // letter of credit
	TPC_DB_GIRO              = "08" // giro(postal banking)
	TPC_DB_DISBURSE          = "09" // goods and services with cash disbursement
	TPC_DB_NON_CASH          = "10" // non-cash financial instrument(e.g.wire transfer)
	TPC_DB_QUASI             = "11" // quasi-cash and scrip
	TPC_DB_SECOND_REQUEST    = "17" // Tender Retail second request message

	// 20-29 credits
	TPC_CR_RETURN       = "20" // returns
	TPC_CR_DEPOSIT      = "21" // deposits
	TPC_CR_ADJUSTMENT   = "22" // adjustment
	TPC_CR_CHEQUE_GUAR  = "23" // cheque deposit guarantee
	TPC_CR_CHEQUE       = "24" // cheque deposit
	TPC_CASH_ADJUSTMENT = "28" // cash adjustment

	// 30-39 inquiry services
	TPC_FUND_INQUIRY    = "30" // available funds inquiry
	TPC_BALANCE_INQUIRY = "31" // balance inquiry

	// 40-49 transfer services
	TPC_TRANSFER            = "40" // cardholder accounts transfer
	TPC_TRANSFER_ADJUSTMENT = "48" // void cardholder accounts transfer

	// 50-59 payment services
	TPC_PAYMENT            = "50" // payment
	TPC_PAYMENT_ADJUSTMENT = "58" // payment adjustment

	// 90-99 reserved for private use
	TPC_ACTIVATE              = "90" // account activation
	TPC_ACTIVATE_ADJUSTMENT   = "91" // void account activation
	TPC_DEACTIVATE            = "92" // account deactivation
	TPC_DEACTIVATE_ADJUSTMENT = "93" // void account deactivation

	// ISO 8583 (1993) account type - field 3(34/56)
	ACCNT_DEFAULT      = "00" // default - unspecified
	ACCNT_SAVING       = "10" // saving account - default
	ACCNT_CHEQUE       = "20" // cheque account - default
	ACCNT_CREDIT       = "30" // credit facility - default
	ACCNT_UNIVERSAL    = "40" // universal account - default
	ACCNT_INVESTMENT   = "50" // investment account - default
	ACCNT_PRIVATELABEL = "90" // private label card
	ACCNT_STOREVALUE   = "91" // store value card
	ACCNT_GIFT         = "92" // gift card

	// ISO Card Data Input Capability (subfield 1)
	CARD_CAPTURE_UNKNOWN     = "00"
	CARD_CAPTURE_MANUAL      = "01"
	CARD_CAPTURE_SWIPED      = "02"
	CARD_CAPTURE_BARCODESCAN = "03"
	CARD_CAPTURE_OCR         = "04"
	CARD_CAPTURE_ICC         = "05"
	CARD_CAPTURE_KEYED       = "06"

	// ISO Card Data PIN Capability (subfield 2)
	PIN_CAPABILITY_UNKNOWN        = "0"
	PIN_CAPABILITY_AVAILABLE      = "1"
	PIN_CAPABILITY_UNAVAILABLE    = "2"
	PIN_CAPABILITY_OUT_OF_SERVICE = "8"
	PIN_VERIFIED_BY_TERMINAL      = "9"
)
View Source
const (

	//ISO8583:1987 data elements
	BIT87_SECONDARY_BITMAP               = 1
	BIT87_PRIMARY_ACCOUNT_NUMBER         = 2
	BIT87_PROCESSING_CODE                = 3
	BIT87_TRANSACTION_AMOUNT             = 4
	BIT87_RECONCILIATION_AMOUNT          = 5
	BIT87_BILLING_AMOUNT                 = 6
	BIT87_TRANSMISSION_DATE_TIME         = 7
	BIT87_BILLING_FEE_AMOUNT             = 8
	BIT87_RECONCILIATION_CONVERSION_RATE = 9
	BIT87_BILLING_CONVERSION_RATE        = 10
	BIT87_SYSTEM_TRACE                   = 11
	BIT87_LOCAL_DATE_TIME                = 12
	BIT87_EFFECTIVE_DATE                 = 13
	BIT87_EXPIRY_DATE                    = 14
	BIT87_SETTLEMENT_DATE                = 15
	BIT87_CONVERSION_DATE                = 16
	BIT87_CAPTURE_DATE                   = 17
	BIT87_MERCHANT_TYPE                  = 18
	BIT87_ACQUIRER_COUNTRY_CODE          = 19
	BIT87_PAN_COUNTRY_CODE               = 20
	BIT87_FORWARD_COUNTRY_CODE           = 21
	BIT87_POS_DATA_CODE                  = 22
	BIT87_CARD_SEQ_NUMBER                = 23
	BIT87_FUNCTION_CODE                  = 24
	BIT87_MSG_REASON_CODE                = 25
	BIT87_ACCEPTOR_BUS_CODE              = 26
	BIT87_APPROVAL_CODE_LEN              = 27
	BIT87_RECONCILIATION_DATE            = 28
	BIT87_RECONCILIATION_INDICATOR       = 29
	BIT87_ORIGINAL_AMOUNT                = 30
	BIT87_ACQUIRER_REFERENCE_DATA        = 31
	BIT87_ACQUIRING_ID                   = 32
	BIT87_FORWARDING_ID                  = 33
	BIT87_EXTEND_PAN                     = 34
	BIT87_TRACK2                         = 35
	BIT87_TRACK3                         = 36
	BIT87_RETRIEVAL_NUMBER               = 37
	BIT87_APPROVAL_CODE                  = 38
	BIT87_ACTION_CODE                    = 39
	BIT87_SERVICE_CODE                   = 40
	BIT87_TERMINAL_ID                    = 41
	BIT87_MERCHANT_ID                    = 42
	BIT87_MERCHANT_NAME                  = 43
	BIT87_ADDITIONAL_RESPONSE_DATA       = 44
	BIT87_TRACK1                         = 45
	BIT87_AMOUNT_FEE                     = 46
	BIT87_ADDIDATA_NATIONAL              = 47
	BIT87_ADDIDATA_PRIVATE               = 48
	BIT87_TXN_CURRENCY_CODE              = 49
	BIT87_RECON_CURRENCY_CODE            = 50
	BIT87_BILLING_CURRENCY_CODE          = 51
	BIT87_ENCRYPTED_PIN                  = 52
	BIT87_SECURITY_CONTROL_INFO          = 53
	BIT87_ADDITIONAL_AMOUNT              = 54
	BIT87_IC_CARD_DATA                   = 55
	BIT87_ORIGINAL_DATA                  = 56
	BIT87_LIFE_CYCLE_CODE                = 57
	BIT87_AUTH_AGENT_CODE                = 58
	BIT87_TRANSPORT_DATA                 = 59
	BIT87_FIELD60                        = 60
	BIT87_FIELD61                        = 61
	BIT87_FIELD62                        = 62
	BIT87_FIELD63                        = 63
	BIT87_MAC1                           = 64
	BIT87_FIELD65                        = 65
	BIT87_ORIGINAL_FEE_AMOUNT            = 66
	BIT87_EXTEND_PAYMENT_DATE            = 67
	BIT87_RECEIVING_COUNTRY_CODE         = 68
	BIT87_SETTLEMENT_COUNTRY_CODE        = 69
	BIT87_AUTH_AGENT_COUNTRY_CODE        = 70
	BIT87_MESSAGE_NUMBER                 = 71
	BIT87_DATA_RECORD                    = 72
	BIT87_ACTION_DATE                    = 73
	BIT87_CREDIT_NUMBER                  = 74
	BIT87_CREDIT_REV_NUMBER              = 75
	BIT87_DEBIT_NUMBER                   = 76
	BIT87_DEBIT_REV_NUMBER               = 77
	BIT87_TRANSFER_NUMBER                = 78
	BIT87_TRANSFER_REV_NUMBER            = 79
	BIT87_INQUIEY_NUMBER                 = 80
	BIT87_AUTHORIZATION_NUMBER           = 81
	BIT87_INQUIRY_REV_NUMBER             = 82
	BIT87_PAYMENT_NUMBER                 = 83
	BIT87_PAYMENT_REV_NUMBER             = 84
	BIT87_FEE_COLLECTION_NUMBER          = 85
	BIT87_CREDIT_AMOUNT                  = 86
	BIT87_CREDIT_REV_AMOUNT              = 87
	BIT87_DEBIT_AMOUNT                   = 88
	BIT87_DEBIT_REV_AMOUNT               = 89
	BIT87_AUTHORIZATION_REV_NUMBER       = 90
	BIT87_TXN_DEST_COUNTRY_CODE          = 91
	BIT87_TXN_ORIG_COUNTRY_CODE          = 92
	BIT87_TXN_DEST_ID                    = 93
	BIT87_TXN_ORIG_ID                    = 94
	BIT87_ISSUER_REFER_DATA              = 95
	BIT87_KEY_MGMT_DATA                  = 96
	BIT87_NET_AMOUNT                     = 97
	BIT87_PAYEE                          = 98
	BIT87_SETTLEMENT_ID_CODE             = 99
	BIT87_RECEIVING_ID_CODE              = 100
	BIT87_FILE_NAME                      = 101
	BIT87_ACCNT_ID1                      = 102
	BIT87_ACCNT_ID2                      = 103
	BIT87_TXN_DESCRIPTION                = 104
	BIT87_CREDIT_CHARGEBACK_AMOUNT       = 105
	BIT87_DEBIT_CHARGEBACK_AMOUNT        = 106
	BIT87_CREDIT_CHARGEBACK_NUMBER       = 107
	BIT87_DEBIT_CHARGEBACK_NUMBER        = 108
	BIT87_CREDIT_FEE_AMOUNT              = 109
	BIT87_DEBIT_FEE_AMOUNT               = 110
	BIT87_FIELD111                       = 111
	BIT87_FIELD112                       = 112
	BIT87_FIELD113                       = 113
	BIT87_FIELD114                       = 114
	BIT87_FIELD115                       = 115
	BIT87_FIELD116                       = 116
	BIT87_FIELD117                       = 117
	BIT87_FIELD118                       = 118
	BIT87_FIELD119                       = 119
	BIT87_FIELD120                       = 120
	BIT87_FIELD121                       = 121
	BIT87_FIELD122                       = 122
	BIT87_FIELD123                       = 123
	BIT87_FIELD124                       = 124
	BIT87_FIELD125                       = 125
	BIT87_FIELD126                       = 126
	BIT87_FIELD127                       = 127
	BIT87_MAC2                           = 128

	//ISO8583:1993 data elements
	BIT93_SECONDARY_BITMAP               = 1
	BIT93_PRIMARY_ACCOUNT_NUMBER         = 2
	BIT93_PROCESSING_CODE                = 3
	BIT93_TRANSACTION_AMOUNT             = 4
	BIT93_RECONCILIATION_AMOUNT          = 5
	BIT93_BILLING_AMOUNT                 = 6
	BIT93_TRANSMISSION_DATE_TIME         = 7
	BIT93_BILLING_FEE_AMOUNT             = 8
	BIT93_RECONCILIATION_CONVERSION_RATE = 9
	BIT93_BILLING_CONVERSION_RATE        = 10
	BIT93_SYSTEM_TRACE                   = 11
	BIT93_LOCAL_DATE_TIME                = 12
	BIT93_EFFECTIVE_DATE                 = 13
	BIT93_EXPIRY_DATE                    = 14
	BIT93_SETTLEMENT_DATE                = 15
	BIT93_CONVERSION_DATE                = 16
	BIT93_CAPTURE_DATE                   = 17
	BIT93_MERCHANT_TYPE                  = 18
	BIT93_ACQUIRER_COUNTRY_CODE          = 19
	BIT93_PAN_COUNTRY_CODE               = 20
	BIT93_FORWARD_COUNTRY_CODE           = 21
	BIT93_POS_DATA_CODE                  = 22
	BIT93_CARD_SEQ_NUMBER                = 23
	BIT93_FUNCTION_CODE                  = 24
	BIT93_MSG_REASON_CODE                = 25
	BIT93_ACCEPTOR_BUS_CODE              = 26
	BIT93_APPROVAL_CODE_LEN              = 27
	BIT93_RECONCILIATION_DATE            = 28
	BIT93_RECONCILIATION_INDICATOR       = 29
	BIT93_ORIGINAL_AMOUNT                = 30
	BIT93_ACQUIRER_REFERENCE_DATA        = 31
	BIT93_ACQUIRING_ID                   = 32
	BIT93_FORWARDING_ID                  = 33
	BIT93_EXTEND_PAN                     = 34
	BIT93_TRACK2                         = 35
	BIT93_TRACK3                         = 36
	BIT93_RETRIEVAL_NUMBER               = 37
	BIT93_APPROVAL_CODE                  = 38
	BIT93_ACTION_CODE                    = 39
	BIT93_SERVICE_CODE                   = 40
	BIT93_TERMINAL_ID                    = 41
	BIT93_MERCHANT_ID                    = 42
	BIT93_MERCHANT_NAME                  = 43
	BIT93_ADDITIONAL_RESPONSE_DATA       = 44
	BIT93_TRACK1                         = 45
	BIT93_AMOUNT_FEE                     = 46
	BIT93_ADDIDATA_NATIONAL              = 47
	BIT93_ADDIDATA_PRIVATE               = 48
	BIT93_TXN_CURRENCY_CODE              = 49
	BIT93_RECON_CURRENCY_CODE            = 50
	BIT93_BILLING_CURRENCY_CODE          = 51
	BIT93_ENCRYPTED_PIN                  = 52
	BIT93_SECURITY_CONTROL_INFO          = 53
	BIT93_ADDITIONAL_AMOUNT              = 54
	BIT93_IC_CARD_DATA                   = 55
	BIT93_ORIGINAL_DATA                  = 56
	BIT93_LIFE_CYCLE_CODE                = 57
	BIT93_AUTH_AGENT_CODE                = 58
	BIT93_TRANSPORT_DATA                 = 59
	BIT93_FIELD60                        = 60
	BIT93_FIELD61                        = 61
	BIT93_FIELD62                        = 62
	BIT93_FIELD63                        = 63
	BIT93_MAC1                           = 64
	BIT93_FIELD65                        = 65
	BIT93_ORIGINAL_FEE_AMOUNT            = 66
	BIT93_EXTEND_PAYMENT_DATE            = 67
	BIT93_RECEIVING_COUNTRY_CODE         = 68
	BIT93_SETTLEMENT_COUNTRY_CODE        = 69
	BIT93_AUTH_AGENT_COUNTRY_CODE        = 70
	BIT93_MESSAGE_NUMBER                 = 71
	BIT93_DATA_RECORD                    = 72
	BIT93_ACTION_DATE                    = 73
	BIT93_CREDIT_NUMBER                  = 74
	BIT93_CREDIT_REV_NUMBER              = 75
	BIT93_DEBIT_NUMBER                   = 76
	BIT93_DEBIT_REV_NUMBER               = 77
	BIT93_TRANSFER_NUMBER                = 78
	BIT93_TRANSFER_REV_NUMBER            = 79
	BIT93_INQUIEY_NUMBER                 = 80
	BIT93_AUTHORIZATION_NUMBER           = 81
	BIT93_INQUIRY_REV_NUMBER             = 82
	BIT93_PAYMENT_NUMBER                 = 83
	BIT93_PAYMENT_REV_NUMBER             = 84
	BIT93_FEE_COLLECTION_NUMBER          = 85
	BIT93_CREDIT_AMOUNT                  = 86
	BIT93_CREDIT_REV_AMOUNT              = 87
	BIT93_DEBIT_AMOUNT                   = 88
	BIT93_DEBIT_REV_AMOUNT               = 89
	BIT93_AUTHORIZATION_REV_NUMBER       = 90
	BIT93_TXN_DEST_COUNTRY_CODE          = 91
	BIT93_TXN_ORIG_COUNTRY_CODE          = 92
	BIT93_TXN_DEST_ID                    = 93
	BIT93_TXN_ORIG_ID                    = 94
	BIT93_ISSUER_REFER_DATA              = 95
	BIT93_KEY_MGMT_DATA                  = 96
	BIT93_NET_AMOUNT                     = 97
	BIT93_PAYEE                          = 98
	BIT93_SETTLEMENT_ID_CODE             = 99
	BIT93_RECEIVING_ID_CODE              = 100
	BIT93_FILE_NAME                      = 101
	BIT93_ACCNT_ID1                      = 102
	BIT93_ACCNT_ID2                      = 103
	BIT93_TXN_DESCRIPTION                = 104
	BIT93_CREDIT_CHARGEBACK_AMOUNT       = 105
	BIT93_DEBIT_CHARGEBACK_AMOUNT        = 106
	BIT93_CREDIT_CHARGEBACK_NUMBER       = 107
	BIT93_DEBIT_CHARGEBACK_NUMBER        = 108
	BIT93_CREDIT_FEE_AMOUNT              = 109
	BIT93_DEBIT_FEE_AMOUNT               = 110
	BIT93_FIELD111                       = 111
	BIT93_FIELD112                       = 112
	BIT93_FIELD113                       = 113
	BIT93_FIELD114                       = 114
	BIT93_FIELD115                       = 115
	BIT93_FIELD116                       = 116
	BIT93_FIELD117                       = 117
	BIT93_FIELD118                       = 118
	BIT93_FIELD119                       = 119
	BIT93_FIELD120                       = 120
	BIT93_FIELD121                       = 121
	BIT93_FIELD122                       = 122
	BIT93_FIELD123                       = 123
	BIT93_FIELD124                       = 124
	BIT93_FIELD125                       = 125
	BIT93_FIELD126                       = 126
	BIT93_FIELD127                       = 127
	BIT93_MAC2                           = 128

	//ISO8583:2003 data elements
	BIT03_SECONDARY_BITMAP                 = 1
	BIT03_PRIMARY_ACCOUNT_NUMBER           = 2
	BIT03_PROCESSING_CODE                  = 3
	BIT03_TRANSACTION_AMOUNT               = 4
	BIT03_RECONCILIATION_AMOUNT            = 5
	BIT03_BILLING_AMOUNT                   = 6
	BIT03_TRANSMISSION_DATE_TIME           = 7
	BIT03_BILLING_FEE_AMOUNT               = 8
	BIT03_RECONCILIATION_CONVERSION_RATE   = 9
	BIT03_BILLING_CONVERSION_RATE          = 10
	BIT03_SYSTEM_TRACE                     = 11
	BIT03_LOCAL_DATE_TIME                  = 12
	BIT03_EFFECTIVE_DATE                   = 13
	BIT03_EXPIRY_DATE                      = 14
	BIT03_SETTLEMENT_DATE                  = 15
	BIT03_CONVERSION_DATE                  = 16
	BIT03_CAPTURE_DATE                     = 17
	BIT03_ERROR_INDICATOR                  = 18
	BIT03_ACQUIRER_COUNTRY_CODE            = 19
	BIT03_PAN_COUNTRY_CODE                 = 20
	BIT03_TXN_LIFECYCLE_DATA               = 21
	BIT03_POS_DATA_CODE                    = 22
	BIT03_CARD_SEQ_NUMBER                  = 23
	BIT03_FUNCTION_CODE                    = 24
	BIT03_MSG_REASON_CODE                  = 25
	BIT03_MERCHANT_CATEGORY_CODE           = 26
	BIT03_POS_CAPABILITY                   = 27
	BIT03_RECONCILIATION_DATE              = 28
	BIT03_RECONCILIATION_INDICATOR         = 29
	BIT03_ORIGINAL_AMOUNT                  = 30
	BIT03_ACQUIRER_REFERENCE_DATA          = 31
	BIT03_ACQUIRING_ID                     = 32
	BIT03_FORWARDING_ID                    = 33
	BIT03_ECOMMERCE_DATA                   = 34
	BIT03_TRACK2                           = 35
	BIT03_TRACK3                           = 36
	BIT03_RETRIEVAL_NUMBER                 = 37
	BIT03_APPROVAL_CODE                    = 38
	BIT03_ACTION_CODE                      = 39
	BIT03_SERVICE_CODE                     = 40
	BIT03_TERMINAL_ID                      = 41
	BIT03_MERCHANT_ID                      = 42
	BIT03_MERCHANT_DATA                    = 43
	BIT03_ADDITIONAL_RESPONSE_DATA         = 44
	BIT03_TRACK1                           = 45
	BIT03_AMOUNT_FEE                       = 46
	BIT03_ADDIDATA_NATIONAL                = 47
	BIT03_ADDIDATA_PRIVATE                 = 48
	BIT03_VERIF_DATA                       = 49
	BIT03_FIELD50                          = 50
	BIT03_FIELD51                          = 51
	BIT03_ENCRYPTED_PIN                    = 52
	BIT03_SECURITY_CONTROL_INFO            = 53
	BIT03_ADDITIONAL_AMOUNT                = 54
	BIT03_IC_CARD_DATA                     = 55
	BIT03_ORIGINAL_DATA                    = 56
	BIT03_LIFE_CYCLE_CODE                  = 57
	BIT03_AUTH_AGENT_CODE                  = 58
	BIT03_TRANSPORT_DATA                   = 59
	BIT03_FIELD60                          = 60
	BIT03_FIELD61                          = 61
	BIT03_FIELD62                          = 62
	BIT03_FIELD63                          = 63
	BIT03_MAC1                             = 64
	BIT03_FIELD65                          = 65
	BIT03_ORIGINAL_FEE_AMOUNT              = 66
	BIT03_EXTEND_PAYMENT_DATE              = 67
	BIT03_FILE_TRANSFER_CONTROL            = 68
	BIT03_FILE_TRANSFER_CONTROL_DATA       = 69
	BIT03_FILE_TRANSFER_DESCRIPTION        = 70
	BIT03_FIELD71                          = 71
	BIT03_DATA_RECORD                      = 72
	BIT03_ACTION_DATE                      = 73
	BIT03_RECONCILIATION_DATA_PRIMARY      = 74
	BIT03_RECONCILIATION_DATA_SECONDARY    = 75
	BIT03_FIELD76                          = 76
	BIT03_FIELD77                          = 77
	BIT03_FIELD78                          = 78
	BIT03_FIELD79                          = 79
	BIT03_FIELD80                          = 80
	BIT03_FIELD81                          = 81
	BIT03_FIELD82                          = 82
	BIT03_FIELD83                          = 83
	BIT03_FIELD84                          = 84
	BIT03_FIELD85                          = 85
	BIT03_FIELD86                          = 86
	BIT03_FIELD87                          = 87
	BIT03_FIELD88                          = 88
	BIT03_FIELD89                          = 89
	BIT03_FIELD90                          = 90
	BIT03_FIELD91                          = 91
	BIT03_FIELD92                          = 92
	BIT03_TXN_DEST_ID                      = 93
	BIT03_TXN_ORIG_ID                      = 94
	BIT03_ISSUER_REFER_DATA                = 95
	BIT03_KEY_MGMT_DATA                    = 96
	BIT03_NET_RECONCILIATION_AMOUNT        = 97
	BIT03_PAYEE                            = 98
	BIT03_SETTLEMENT_ID_CODE               = 99
	BIT03_RECEIVING_ID_CODE                = 100
	BIT03_FILE_NAME                        = 101
	BIT03_ACCNT_ID1                        = 102
	BIT03_ACCNT_ID2                        = 103
	BIT03_TXN_DESCRIPTION                  = 104
	BIT03_FIELD105                         = 105
	BIT03_FIELD106                         = 106
	BIT03_FIELD107                         = 107
	BIT03_FIELD108                         = 108
	BIT03_RECONCILIATION_FEE_AMOUNT_CREDIT = 109
	BIT03_RECONCILIATION_FEE_AMOUNT_DEBIT  = 110
	BIT03_FIELD111                         = 111
	BIT03_FIELD112                         = 112
	BIT03_FIELD113                         = 113
	BIT03_FIELD114                         = 114
	BIT03_FIELD115                         = 115
	BIT03_FIELD116                         = 116
	BIT03_FIELD117                         = 117
	BIT03_FIELD118                         = 118
	BIT03_FIELD119                         = 119
	BIT03_FIELD120                         = 120
	BIT03_FIELD121                         = 121
	BIT03_FIELD122                         = 122
	BIT03_FIELD123                         = 123
	BIT03_FIELD124                         = 124
	BIT03_FIELD125                         = 125
	BIT03_FIELD126                         = 126
	BIT03_FIELD127                         = 127
	BIT03_MAC2                             = 128
)
View Source
const (
	SPEC1987 = "1987"
	SPEC1993 = "1993"
	SPEC2003 = "2003"
)
View Source
const (
	RC87_APPROVED                                                 = "00" //Successful approval/completion or that V.I.P. PIN verification is valid
	RC87_REFER_TO_ISSUER                                          = "01" //Refer to card issuer
	RC87_REFER_TO_ISSUER_SPECIAL_CONDITION                        = "02" //Refer to card issuer, special condition
	RC87_INVALID_MERCHANT                                         = "03" //Invalid merchant or service provider
	RC87_PICKUP_CARD                                              = "04" //Pickup card
	RC87_DO_NOT_HONOR                                             = "05" //Do not honor
	RC87_ERROR                                                    = "06" //Error
	RC87_PICKUP_CARD_SPECIAL_CONDITION                            = "07" //Pickup card, special condition (other than lost/stolen card)
	RC87_PARTIAL_APPROVAL                                         = "10" //Partial Approval
	RC87_VIP_APPROVAL                                             = "51" //V.I.P. approval
	RC87_INVALID_TXN                                              = "12" //Invalid transaction
	RC87_INVALID_AMOUNT                                           = "13" //Invalid amount (currency conversion field overflow)
	RC87_INVALID_ACCOUNT_NUMBER                                   = "14" //Invalid account number (no such number)
	RC87_NO_SUCH_ISSUER                                           = "15" //No such issuer
	RC87_CUSTOMER_CANCELLATION                                    = "17" //Customer cancellation
	RC87_RE_ENTER_TXN                                             = "19" //Re-enter transaction
	RC87_INVALID_RESPONSE                                         = "20" //Invalid response
	RC87_NO_ACTION_TAKEN                                          = "21" //No action taken (unable to back out prior transaction)
	RC87_SUSPECTED_MALFUNCTION                                    = "22" //Suspected Malfunction
	RC87_UNABLE_TO_LOCATE_RECORD                                  = "25" //Unable to locate record in file, or account number is missing from the inquiry
	RC87_FILE_TEMPORARILY_UNAVAILABLE                             = "28" //File is temporarily unavailable
	RC87_FORMAT_ERROR                                             = "30" //Format Error
	RC87_PICKUP_CARD_LOST                                         = "41" //Pickup card (lost card)
	RC87_PICKUP_CARD_STOLEN                                       = "43" //Pickup card (stolen card)
	RC87_INSUFFICIENT_FUNDS                                       = "51" //Insufficient funds
	RC87_NO_CHECKING_ACCOUNT                                      = "52" //No checking account
	RC87_NO_SAVINGS_ACCOUNT                                       = "53" //No savings account
	RC87_EXPIRED_CARD                                             = "54" //Expired card
	RC87_INCORRECT_PIN                                            = "55" //Incorrect PIN
	RC87_TXN_NOT_PERMITTED_TO_CARDHOLDER                          = "57" //Transaction not permitted to cardholder
	RC87_TXN_NOT_ALLOWED_AT_TERMINAL                              = "58" //Transaction not allowed at terminal
	RC87_SUSPECTED_FRAUD                                          = "59" //Suspected fraud
	RC87_ACTIVITY_AMOUNT_LIMIT_EXCEEDED                           = "61" //Activity amount limit exceeded
	RC87_RESTRICTED_CARD                                          = "62" //Restricted card (for example, in Country Exclusion table)
	RC87_SECURITY_VIOLATION                                       = "63" //Security violation
	RC87_ACTIVITY_COUNT_LIMIT_EXCEEDED                            = "65" //Activity count limit exceeded
	RC87_RESPONSE_RECEIVED_TOO_LATE                               = "68" //Response received too late
	RC87_PIN_ENTRY_TRIES_EXCEEDED                                 = "75" //Allowable number of PIN-entry tries exceeded
	RC87_UNABLE_TO_LOCATE_PREVIOUS_MESSAGE                        = "76" //Unable to locate previous message (no match on Retrieval Reference number)
	RC87_INCONSISTENT_REPEAT_REVERSAL_DATA                        = "77" //Previous message located for a repeat or reversal, but repeat or reversal data are inconsistent with original message
	RC87_BLOCKED_FIRST_USE                                        = "78" //'Blocked, first used'-The transaction is from a new cardholder, and the card has not been properly unblocked.
	RC87_VISA_TXN_CREDIT_ISSUER_UNAVAILABLE                       = "80" //Visa transactions: credit issuer unavailable. Private label and check acceptance: Invalid date
	RC87_PIN_CRYPTOGRAPHIC_ERROR                                  = "81" //PIN cryptographic error found (error found by VIC security module during PIN decryption)
	RC87_NEGATIVE_CAM_DCVV_ICVV_OR_CVV_RESULT                     = "82" //Negative CAM, dCVV, iCVV, or CVV results
	RC87_UNABLE_TO_VERIFY_PIN                                     = "83" //Unable to verify PIN
	RC87_NO_REASON_TO_DECLINE_A_REQUEST                           = "85" //No reason to decline a request for account number verification, address verification, CVV2 verification, or a credit voucher or merchandise return
	RC87_ISSUER_OR_SWITCH_UNAVAILABLE                             = "91" //Issuer unavailable or switch inoperative (STIP not applicable or available for this transaction)
	RC87_ROUTING_DESTINATION_NOT_FOUND                            = "92" //Destination cannot be found for routing
	RC87_ILLEGAL_TXN                                              = "93" //Transaction cannot be completed, violation of law
	RC87_DUPLICATE_TRANSMISSION                                   = "94" //Duplicate Transmission
	RC87_RECONCILIATION_ERROR                                     = "95" //Reconcile error
	RC87_SYSTEM_MALFUNCTION_OR_FIELD_ERROR                        = "96" //System malfunction, System malfunction or certain field error conditions
	RC87_US_ACQUIRER_SURCHARGE_AMOUNT_NOT_PERMITTED_ON_VISA_CARDS = "B1" //Surcharge amount not permitted on Visa cards (U.S. acquirers only)
	RC87_FORCE_STIP                                               = "N0" //Force STIP
	RC87_CASH_SERVICE_NOT_AVAILABLE                               = "N3" //Cash service not available
	RC87_CASHBACK_REQUEST_EXCEEDS_ISSUER_LIMIT                    = "N4" //Cashback request exceeds issuer limit
	RC87_DECLINE_FOR_CVV2_FAILURE                                 = "N7" //Decline for CVV2 failure
	RC87_INVALID_BILLER_INFORMATION                               = "P2" //Invalid biller information
	RC87_PIN_CHANGE_UNBLOCK_REQUEST_DECLINED                      = "P5" //PIN Change/Unblock request declined
	RC87_UNSAFE_PIN                                               = "P6" //Unsafe PIN
	RC87_CARD_AUTHENTICATION_FAILED                               = "Q1" //Card Authentication failed
	RC87_STOP_PAYMENT_ORDER                                       = "R0" //Stop Payment Order
	RC87_REVOCATION_OF_AUTHORIZATION_ORDER                        = "R1" //Revocation of Authorization Order
	RC87_REVOCATION_OF_ALL_AUTHORIZATIONS_ORDER                   = "R3" //Revocation of All Authorizations Order
	RC87_FORWARD_TO_ISSUER1                                       = "XA" //Forward to issuer
	RC87_FORWARD_TO_ISSUER2                                       = "XD" //Forward to issuer
	RC87_UNABLE_TO_GO_ONLINE                                      = "Z3" //Unable to go online
)

Variables

View Source
var (
	Currencies = map[string]Currency{}/* 166 elements not displayed */

)

Functions

func BitMapLen

func BitMapLen(m []byte) int

Len returns the length (in bits) of the provided byteslice. It will always be a multipile of 8 bits.

func ClearBit

func ClearBit(m []byte, i int)

func DecodeFieldID

func DecodeFieldID(fieldID string) (spec string, indices []int, level int, err error)

func GetBit

func GetBit(m []byte, i int) bool

Get returns the value of bit i from map m i = 0 gets the left most bit or most significant bit

func SetBit

func SetBit(m []byte, i int)

Set sets bit i of map m to value v. It doesn't check the bounds of the slice.

func SetConfig

func SetConfig(specFiles []string) (err error)

func ValidateMti

func ValidateMti(mti string) error

MtiValidator validates and iso8583 mti

Types

type Currency

type Currency struct {
	Code     string
	Name     string
	Country  string
	Number   string
	Decimals int
}

type Field

type Field struct {
	ID        string
	Value     string //the decoded value that can be used as is
	Subfields map[int]Field
}

func (Field) Validate

func (f Field) Validate() (err error)

type FieldDescription

type FieldDescription struct {
	ContentType string                   `yaml:"ContentType"`
	MaxLen      int                      `yaml:"MaxLen"`
	MinLen      int                      `yaml:"MinLen"`
	LenType     string                   `yaml:"LenType"`
	Label       string                   `yaml:"Label"`
	Format      string                   `yaml:"Format"`
	Subfields   map[int]FieldDescription `yaml:"Subfields"`
}

FieldDescription contains fields that describes an iso8583 Field

func DescribeField

func DescribeField(fieldID string) (desc FieldDescription, indices []int, level int, err error)

returns a field description for a field field id must be in the format spec.index.subindex.subindex... Example: 2003.30.1.2

type MandatoryFields

type MandatoryFields struct {
	Fields map[string]map[int]string
}

type Message

type Message struct {
	// contains filtered or unexported fields
}

IsoStruct is an iso8583 container

func NewMessage

func NewMessage(specName string) (iso Message, err error)

func Parse

func Parse(i string) (iso Message, err error)

Parse parses an iso8583 string

func (*Message) AddField

func (iso *Message) AddField(field int, data string) error

AddField adds the provided iso8583 field into the current struct also updates the bitmap in the process

func (*Message) AddMTI

func (iso *Message) AddMTI(data string) error

AddMTI adds the provided iso8583 MTI into the current struct also updates the bitmap in the process

func (*Message) AddOriginalTransactionAmount

func (iso *Message) AddOriginalTransactionAmount(currency, amount, decimals int64) (err error)

func (*Message) AddTransactionAmount

func (iso *Message) AddTransactionAmount(currency, amount, decimals int64) (err error)

func (Message) Bitmap

func (iso Message) Bitmap() []byte

func (Message) Data

func (iso Message) Data() map[int]Field

func (Message) Error

func (message Message) Error(code string) (response string, err error)

func (*Message) GetField

func (iso *Message) GetField(index int) (field Field, err error)

func (*Message) GetFlow

func (iso *Message) GetFlow() (flow, response MessageFlow, err error)

func (*Message) GetMandatoryFields

func (m *Message) GetMandatoryFields() (mandatory, echo, ifAvailable []int, err error)

func (*Message) GetTransactionAmount

func (iso *Message) GetTransactionAmount(index int) (amount float64, currencyCode string, err error)

func (*Message) MessageCode

func (iso *Message) MessageCode() (code string)

func (Message) Mti

func (iso Message) Mti() string

func (*Message) Response

func (iso *Message) Response(messageClass, responseCode string) (response Message, err error)

func (*Message) ResponseStr

func (iso *Message) ResponseStr(messageClass, responseCode string) (response string, err error)

func (Message) Spec

func (iso Message) Spec() Spec

func (*Message) ToString

func (iso *Message) ToString() (string, error)

ToString packs the mti, bitmap and elements into a string

func (*Message) UpdateOriginalTransactionAmount

func (iso *Message) UpdateOriginalTransactionAmount(amount int64) (err error)

func (*Message) UpdateTransactionAmount

func (iso *Message) UpdateTransactionAmount(amount int64) (err error)

func (*Message) ValidateFlowFields

func (iso *Message) ValidateFlowFields() (err error)

This gets very complex, so won't validate now, but framework is prepared

type MessageFlow

type MessageFlow struct {
	RepeaterMTI     string
	ResponseMTI     string
	Response        string
	Context         string
	Flow            string
	Name            string
	Source          string
	Destination     string
	Description     string
	MandatoryFields map[int]string
}

type Spec

type Spec struct {
	// contains filtered or unexported fields
}

Spec contains a strutured description of an iso8583 spec properly defined by a spec file

func GetFieldSpec

func GetFieldSpec(fieldID string) (spec Spec, err error)

func SpecFromFile

func SpecFromFile(filename string) (Spec, error)

SpecFromFile returns a brand new empty spec

func (Spec) Version

func (s Spec) Version() string

type ValidationError

type ValidationError struct {
	// contains filtered or unexported fields
}

ValidationError happens when validation fails

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL