home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / zines / phrack2 / phrack46.016 < prev    next >
Encoding:
Text File  |  2003-06-11  |  43.4 KB  |  944 lines

  1.                               ==Phrack Magazine==
  2.  
  3.                  Volume Five, Issue Forty-Six, File 16 of 28
  4.  
  5. ****************************************************************************
  6.  
  7.                         VisaNet Operations (Continued)
  8.  
  9. 4.22 TRANSACTION AMOUNT
  10.  
  11. This is a variable field from three to twelve digits in length.  The transaction
  12. amount includes the amount in 4.28, Secondary Amount.  Therefore, field 4.22
  13. must be greater than or equal to field 4.28.
  14.  
  15. The transaction amount is presented by the terminal with an implied decimal
  16. point.  For example $.01 would be represented in the record as "001".  When the
  17. terminal is used with an authorization system which supports the US dollar as
  18. the primary currency, the amount field must be limited to seven digits
  19. (9999999). [...]  The terminal may be used with authorization system which
  20. support other currencies that require the full twelve-digit field.
  21.  
  22. 4.23 FIELD SEPARATOR
  23.  
  24. The authorization record format specifies the use of the "FS" character.
  25.  
  26. 4.24 DEVICE CODE/INDUSTRY CODE
  27.  
  28. This field is used to identify the device type which generated the transaction
  29. and the industry type of the merchant.  Table 4.24 provides a brief summary of
  30. the current codes.
  31.  
  32.                                    TABLE 4.24
  33.                            Device Code/Industry Code
  34.  
  35. C                                      C
  36. O                                      O
  37. D                                      D
  38. E          DEVICE TYPE                 E            INDUSTRY TYPE
  39. -------------------------------------------------------------------------------
  40. 0   Unknown or Unsure                  0   Unknown or Unsure
  41. 1          RESERVED                    1              RESERVED
  42. 2          RESERVED                    2              RESERVED
  43. 3          RESERVED                    3              RESERVED
  44. 4          RESERVED                    4              RESERVED
  45. 5          RESERVED                    5              RESERVED
  46. 6          RESERVED                    6              RESERVED
  47. 7          RESERVED                    7              RESERVED
  48. 8          RESERVED                    8              RESERVED
  49. 9          RESERVED                    9              RESERVED
  50. A          RESERVED                    A              RESERVED
  51. B          RESERVED                    B   Bank/Financial Institution
  52. C   P.C.                               C              RESERVED
  53. D   Dial Terminal                      D              RESERVED
  54. E   Electronic Cash Register (ECR)     E              RESERVED
  55. F          RESERVED                    F   Food/Restaurant
  56. G          RESERVED                    G   Grocery Store/Supermarket
  57. H          RESERVED                    H   Hotel
  58. I   In-Store Processor                 I              RESERVED
  59. J          RESERVED                    J              RESERVED
  60. K          RESERVED                    K              RESERVED
  61. L          RESERVED                    L              RESERVED
  62. M   Main Frame                         M   Mail Order
  63. N          RESERVED                    N              RESERVED
  64. O          RESERVED                    O              RESERVED
  65. P   POS-port                           P              RESERVED
  66. Q       RESERVED for POS-port          Q              RESERVED
  67. R          RESERVED                    R   Retail
  68. S          RESERVED                    S              RESERVED
  69. T          RESERVED                    T              RESERVED
  70. U          RESERVED                    U              RESERVED
  71. V          RESERVED                    V              RESERVED
  72. W          RESERVED                    W              RESERVED
  73. X          RESERVED                    X              RESERVED
  74. Y          RESERVED                    Y              RESERVED
  75. Z          RESERVED                    Z              RESERVED
  76. --------------------------------------------------------------------------------
  77.  
  78. 4.25 FIELD SEPARATOR
  79.  
  80. The authorization record format specifies the use of the "FS" character.
  81.  
  82. 4.26 ISSUING INSTITUTION ID/RECEIVING INSTITUTION ID
  83.  
  84. This six-digit field is provided by the merchant signing member and is present
  85. when the terminal is used to process transactions which can not be routed using
  86. the cardholder Primary Account Number.  When a value is present in this field,
  87. it is used as an RIID for all valid transaction codes, field 4.12, except 81
  88. through 88.  This field is used as an IIID for transaction codes 81 through 88.
  89. Table 4.26 provides a summary of the RIID codes for check acceptance.
  90.  
  91.                                    TABLE 4.26
  92.                           Check Acceptance RIID Values
  93.  
  94.                          Vendor                 RIID
  95.                          ---------------------------
  96.                          JBS, Inc             810000
  97.                          Telecheck            861400
  98.                          TeleCredit, West     894300 [note; telecredit has been
  99.                          TeleCredit, East     894400  mutated/eaten by equifax]
  100.                          ---------------------------
  101.  
  102. 4.27 FIELD SEPARATOR
  103.  
  104. The authorization record format specifies the use of the "FS" character.
  105.  
  106. 4.28 SECONDARY AMOUNT (CASHBACK)
  107.  
  108. NOTE: "Cashback" is NOT allowed on Visa cards when the Customer Data Field,
  109. see section 4.18, has been manually entered.
  110.  
  111. This is a variable length field from three to twelve digits in length.  The
  112. Secondary Amount is included in field 4.22, Transaction Amount.
  113.  
  114. The secondary amount is presented by the terminal with an implied decimal point.
  115. For example $.01 would be represented in the record as "001".  This field will
  116. contain 000 when no secondary amount has been requested.  Therefore, when the
  117. terminal is used with an authorization system which supports the US dollar as
  118. the primary currency, the secondary amount field must be limited to seven
  119. digits (9999999).  The terminal may be used with authorization systems which
  120. support other currencies that require the full twelve-digit field.
  121.  
  122. 4.29 FIELD SEPARATOR
  123.  
  124. The authorization record format specifies the use of the "FS" character.
  125.  
  126. 4.30 MERCHANT NAME
  127.  
  128. This 25-character field contains the merchant name provided by the signing
  129. member.  the name must correspond to the name printed on the customer receipt.
  130. The name is left justified with space fill.  The first character position can
  131. not be a space.  This field must contain the same used in the data capture
  132. batch.
  133.  
  134. 4.32 MERCHANT STATE
  135.  
  136. This two-character field contains the merchant location state abbreviation
  137. provided by the singing member.  The abbreviation must correspond to the state
  138. name printed on the customer receipt and be one of the Visa accepted
  139. abbreviations.  This field must contain the same data used in the data capture
  140. batch.
  141.  
  142. 4.33 SHARING GROUP
  143.  
  144. This one to fourteen-character field contains the group of debit card/network
  145. types that a terminal may have access to and is provided by the singing member.
  146. The values must correspond to one of the Visa assigned debit card /network
  147. types.  This data is part of the VisaNet debit data.
  148.  
  149. 4.34 FIELD SEPARATOR
  150.  
  151. The authorization record format specifies the use of the "FS" character.
  152.  
  153. 4.35 MERCHANT ABA NUMBER
  154.  
  155. This fixed length field is twelve digits in length.  If this field is not used,
  156. its length must be zero.  If this field is not used, the following field must
  157. also be empty.
  158.  
  159. This number identifies the merchant to a debit switch provided by the signing
  160. member.  The number is provided by the signing member.
  161.  
  162. 4.36 MERCHANT SETTLEMENT AGENT NUMBER
  163.  
  164. This fixed length field is four digits in length.  If this field is not used,
  165. its length must be zero.  If this field is not used, the previous field must
  166. also be empty.
  167.  
  168. This number identifies the merchant settling agent.  The number is provided by
  169. the signing member.
  170.  
  171. 4.37 FIELD SEPARATOR
  172.  
  173. The authorization record format specifies the use of the "FS" character.
  174.  
  175. 4.38 AGENT NUMBER
  176.  
  177. This six-digit field contains an agent number assigned by the signing member.
  178. The number identifies an institution which signs merchants as an agent of a
  179. member.  The member uses this number to identify the agent within the member
  180. systems.  The acquirer BIN, Agent, Chain, Merchant, Store, and Terminal numbers
  181. are required to uniquely identify a terminal within the VisaNet systems.
  182.  
  183. 4.39 CHAIN NUMBER
  184.  
  185. This six-digit field contains a merchant chain identification number assigned
  186. by the singing member.  The member uses this number to identify the merchant
  187. chain within the member systems.  The acquirer BIN, Agent, Chain, Merchant,
  188. Store, and Terminal numbers are required to uniquely identify a terminal within
  189. the VisaNet systems.
  190.  
  191. 4.40 BATCH NUMBER
  192.  
  193. This three-digit field contains a batch sequence number generated by the
  194. terminal.  The number will wrap from 999 to 001.  This number is that data
  195. capture batch number.
  196.  
  197. 4.41 REIMBURSEMENT ATTRIBUTE
  198.  
  199. This is a single character fixed length field.
  200.  
  201. This field contains the reimbursement attribute assigned by the singing member.
  202. This field must be a "space".
  203.  
  204. 4.42 FIELD SEPARATOR
  205.  
  206. The authorization record format specifies the use of the "FS" character.
  207.  
  208. 4.43 APPROVAL CODE
  209.  
  210. This contains a six-character fixed length field.
  211.  
  212. This field is only present in cancel transactions and contains the original
  213. approval code from the original transaction.
  214.  
  215. The approval code was returned in the authorization response of the transaction
  216. to be canceled.
  217.  
  218. 4.44 SETTLEMENT DATE
  219.  
  220. This contains a four-digit fixed length field.
  221.  
  222. This field is only present in cancel transactions and contains the settlement
  223. date from the original transaction and is in the format MMDD.
  224.  
  225. The settlement date was returned in the authorization response of the
  226. transaction to be canceled.
  227.  
  228. 4.45 LOCAL TRANSACTION DATE
  229.  
  230. This contains a four-digit fixed length field.
  231.  
  232. This field is only present in cancel transactions and contains the transaction
  233. date from the original transaction and is in the format MMDD.
  234.  
  235. The transaction date was returned in the authorization response of the
  236. transaction to be canceled as MMDDYY.
  237.  
  238. 4.46 LOCAL TRANSACTION TIME
  239.  
  240. This contains a six-digit fixed length field.
  241.  
  242. This field is only present in cancel transactions and contains the transaction
  243. time from the original transaction and is in the format HHMMSS.
  244.  
  245. The transaction time was returned in the authorization response of the
  246. transaction to be canceled.
  247.  
  248. 4.47 SYSTEM TRACE AUDIT NUMBER
  249.  
  250. This contains a six-character fixed length field.
  251.  
  252. This field is only present in cancel transactions and contains the trace audit
  253. number from the original transaction.
  254.  
  255. The trace audit number was returned in the authorization response of the
  256. transaction to be canceled.
  257.  
  258. 4.48 ORIGINAL AUTHORIZATION TRANSACTION CODE
  259.  
  260. The field is a two-character fixed length field and must contain the original
  261. AUTHORIZATION TRANSACTION CODE (filed 4.12) of the transaction to be canceled.
  262. Currently, the only transaction that can be canceled in an Interlink Debit
  263. Purchase.
  264.  
  265. 4.49 NETWORK IDENTIFICATION CODE
  266.  
  267. This contains a single character fixed length field.
  268.  
  269. This field is only present in cancel transactions and contains the network ID
  270. from the original transaction.
  271.  
  272. The network ID was returned in the authorization response of the transaction to
  273. be canceled.
  274.  
  275. 4.50 FIELD SEPARATOR
  276.  
  277. The authorization record format specifies the use of the "FS" character.
  278.  
  279. 5.0 RESPONSE RECORD DATA ELEMENT DEFINITIONS
  280.  
  281. The following subsections will define the authorization response record data
  282. elements.
  283.  
  284. 5.01 PAYMENT SERVICE INDICATOR
  285.  
  286. This field contains the one-character payment service indicator.  It must be
  287. placed in the batch detail record for terminals that capture.
  288.  
  289. Table 5.01 provides a summary of current Values.
  290.  
  291.                                    TABLE 5.01
  292.                         Payment Service Indicator Values
  293.  
  294.         VALUE   DESCRIPTION
  295.         ------------------------------------------------------------------
  296.           A     REPS qualified
  297.           Y     Requested a "Y" in field 4.14 and there was a problem
  298.                 REPS denied (VAS edit error or BASE I reject)
  299.           N     Requested an "N" in field 4.14 or requested a "Y" in field
  300.                 4.14 and request was downgraded (by VAS)
  301.         space   If "Y" sent and transaction not qualified  (VAS downgrade)
  302.         -------------------------------------------------------------------
  303.  
  304. 5.02 STORE NUMBER
  305.  
  306. This four-digit number is returned by VisaNet from the authorization request for
  307. formats "J" and "G", and can be used to route the response within a store
  308. controller and/or a store concentrator.
  309.  
  310. 5.03 TERMINAL NUMBER
  311.  
  312. This four-digit number is returned by VisaNet from the authorization request for
  313. formats "J" and "G", and can be used to route the response within a store
  314. controller and/or a store concentrator.
  315.  
  316. 5.04 AUTHORIZATION SOURCE CODE
  317.  
  318. This field contains a one-character code that indicates the source of the
  319. authorization.  The received code must be placed in the data capture detail
  320. transaction record when data capture is enabled.
  321.  
  322. Table 5.04 provides a summary of current codes.
  323.  
  324.                                    TABLE 5.04
  325.                            Authorization Source Codes
  326.  
  327.  Code   Description
  328. --------------------------------------------------------------------------------
  329.   1     STIP: time-out response
  330.   2     LCS: amount below issuer limit
  331.   3     STIP: issuer in Suppress-Inquiry mode
  332.   4     STIP: issuer unavailable
  333.   5     Issuer approval
  334.   6     Off-line approval, POS device generated
  335.   7     Acquirer approval: BASE I unavailable
  336.   8     Acquirer approval of a referral
  337.   9     Use for non-authorized transactions; such as credit card credits [yum!]
  338.   D     Referral: authorization code manually keyed
  339.   E     Off-line approval: authorization code manually keyed
  340. --------------------------------------------------------------------------------
  341.  
  342. 5.05 TRANSACTION SEQUENCE NUMBER
  343.  
  344. This field contains the four-digit code which was generated by the terminal as
  345. the sequence number for the transaction and passed to the authorization center
  346. in the authorization request record.  The sequence number can be used by the
  347. terminal to match request and response messages.  The transaction sequence
  348. number is returned by VisaNet without sequence verification.
  349.  
  350. 5.06 RESPONSE CODE
  351.  
  352. This field contains a two-character response code indicating the status of the
  353. authorization.
  354.  
  355. Table 5.06 provides the response codes for formats "J" and "G".  A response code
  356. of "00" represents an approval.  A response code of "85" represents a successful
  357. card verification returned by TRANSACTION CODES 58, 68, and 88.  All other
  358. response codes represent a non-approved request.
  359.  
  360. The value returned is stored in the batch transaction detail record for
  361. terminals that capture.
  362.  
  363.                                    TABLE 5.06
  364.            Authorization Response Codes For Record Formats "J" & "G"
  365.  
  366.   Authorization     Response                                        AVS Result
  367.  Response Message     Code       Response Definition                   Code
  368. --------------------------------------------------------------------------------
  369.    EXACT MATCH         00        Exact Match, 9 digit zip               X
  370.    EXACT MATCH         00        Exact Match, 5 digit zip GRIND         Y
  371.   ADDRESS MATCH        00        Address match only                     A
  372.     ZIP MATCH          00        9-digit zip match only                 W
  373.     ZIP MATCH          00        5-digit zip match only GRIND           Z
  374.      NO MATCH          00        No address or zip match                N
  375.  VER UNAVAILABLE       00        Address unavailable                    U
  376.       RETRY            00        Issuer system unavailable              R
  377.  ERROR INELIGIBLE      00        Not a mail/phone order                 E
  378.  SERV UNAVAILABLE      00        Service not supported                  S
  379.     APPROVAL           00        Approved and completed              see above
  380.      CARD OK           85        No reason to decline                see above
  381.       CALL             01        Refer to issuer                        0
  382.       CALL             02        Refer to issue - Special condition     0
  383.     NO REPLY           28        File is temporarily unavailable        0
  384.     NO REPLY           91        Issuer or switch is unavailable        0
  385.     HOLD-CALL          04        Pick up card                           0
  386.     HOLD-CALL          07        Pick up card - Special condition       0
  387.     HOLD-CALL          41        Pick up card - Lost                    0
  388.     HOLD-CALL          43        Pick up card - Stolen                  0
  389.  ACCT LENGTH ERR       EA        Verification Error                     0
  390.  ALREADY REVERSED      79        Already Reversed at Switch [ya got me] 0
  391.    AMOUNT ERROR        13        Invalid amount                         0
  392.   CAN'T VERIFY PIN     83        Can not verify PIN                     0
  393.    CARD NO ERROR       14        Invalid card number                    0
  394.   CASHBACK NOT APP     82        Cashback amount not approved           0
  395.    CHECK DIGIT ERR     EB        Verification Error                     0
  396.   CID FORMAT ERROR     EC        Verification Error                     0
  397.      DATE ERROR        80        Invalid Date                           0
  398.       DECLINE          05        Do not honor                           0
  399.       DECLINE          51        Not Sufficient Funds                   0
  400.       DECLINE          61        Exceeds Withdrawal Limit               0
  401.       DECLINE          65        Activity Limit Exceeded                0
  402.  ENCRYPTION ERROR      81        Cryptographic Error                    0
  403.       ERROR xx         06        General Error                          0
  404.      ERROR xxxx        06        General Error                          0
  405.     EXPIRED CARD       54        Expired Card                           0
  406.   INVALID ROUTING      98        Destination Not Found                  0
  407.    INVALID TRANS       12        Invalid Transaction                    0
  408.   NO CHECK ACCOUNT     52        No Check Account                       0
  409.   NO SAVE ACCOUNT      54        No Save Account                        0
  410.    NO SUCH ISSUER      15        No Such Issuer                         0
  411.       RE ENTER         19        Re-enter Transaction                   0
  412.     SEC VIOLATION      63        Security Violation                     0
  413.    SERV NOT ALLOWED    57        Trans. not permitted-Card              0
  414.    SERV NOT ALLOWED    58        Trans. not permitted-Terminal          0
  415.    SERVICE CODE ERR    62        Restricted Card                        0
  416.      SYSTEM ERROR      96        System Malfunction [whoop whoop!]      0
  417.      TERM ID ERROR     03        Invalid Merchant ID                    0
  418.       WRONG PIN        55        Incorrect PIN                          0
  419.   xxxxxxxxxxxxxxxxxx   xx        Undefined Response                     0
  420. --------------------------------------------------------------------------------
  421.  
  422. 5.07 APPROVAL CODE
  423.  
  424. This field contains a six-character code when a transaction has been approved.
  425. If the transaction is not approved the contents of the field should be ignored.
  426. The approval code is input to the data capture detail transaction record.
  427.  
  428. 5.08 LOCAL TRANSACTION DATE
  429.  
  430. This field contains a six-digit local date calculated (MMDDYY) by the
  431. authorization center using the time zone differential code provided in the
  432. authorization request message.  This date is used by the terminal as the date to
  433. be printed on the transaction receipts and audit reports, and as the date input
  434. to the data capture transaction detail record.  This field is only valid for
  435. approved transactions.
  436.  
  437. 5.09 AUTHORIZATION RESPONSE MESSAGE
  438.  
  439. This field is a sixteen-character field containing a response display message.
  440. This message is used by the terminal to display the authorization results.
  441. Table 5.06 provides the message summary.   The messages are provided with "sp"
  442. space fill.  This field is mapped to the RESPONSE CODE, field 5.06, for all
  443. non-AVS transactions and for all DECLINED AVS transactions.  For APPROVED AVS
  444. transactions (response code = "00" or "85"), it is mapped to the AVS RESULT
  445. CODE, field 5.10.
  446.  
  447. 5.10 AVS RESULT CODE
  448.  
  449. This one-character field contains the address verification result code.  An
  450. address verification result code is provided for transactions and provides an
  451. additional indication that the card is being used by the person to which the
  452. card was issued.  The service is only available for mail/phone order
  453. transactions.
  454.  
  455. Table 5.06 provides a summary of the AVS Result Codes.
  456.  
  457. An ANSI X3.4 "0" is provided for all non-AVS transactions and all declined
  458. transactions.
  459.  
  460. 5.11 TRANSACTION IDENTIFIER
  461.  
  462. This numeric field will contain a transaction identifier.  The identifier will
  463. be fifteen-digits in length if the payment service indicator value is an "A" or
  464. it will be zero in length if the payment service indicator value is not an "A".
  465. This value is stored in the batch detail record for terminals that capture and
  466. is mandatory for REPS qualification.
  467.  
  468. 5.12 FIELD SEPARATOR
  469.  
  470. The authorization record format specifies the use of the "FS" character.
  471.  
  472. 5.13 VALIDATION CODE
  473.  
  474. This alphanumeric field will contain a validation code.  The code will contain a
  475. four-character value if the payment service indicator value is an "A" or it will
  476. be zero in length if the payment service indicator value is not an "A".  This
  477. value is stored in the batch detail record for terminals that capture and is
  478. mandatory for REPS qualification.
  479.  
  480. 5.14 FIELD SEPARATOR
  481.  
  482. The authorization record format specifies the use of the "FS" character.
  483.  
  484. 5.15 NETWORK IDENTIFICATION CODE
  485.  
  486. This one-character fixed length field contains the identification code of the
  487. network on which the transaction was authorized.  The network ID must be printed
  488. on the receipt.
  489.  
  490. 5.16 SETTLEMENT DATE
  491.  
  492. This four-digit fixed length field contains the transaction settlement date
  493. returned by the authorizing system (MMDD).  The settlement date must be printed
  494. on the receipt.
  495.  
  496. 5.17 SYSTEM TRACE AUDIT NUMBER
  497.  
  498. This six-character fixed length field contains a trace audit number which is
  499. assigned by the authorizing system.  The trace audit number must be printed on
  500. the receipt.
  501.  
  502. 5.18 RETRIEVAL REFERENCE NUMBER
  503.  
  504. This twelve-character fixed length field contains the transaction retrieval
  505. reference number returned by the authorizing system.  The reference number
  506. should be printed on the receipt.
  507.  
  508. 5.19 LOCAL TRANSACTION TIME
  509.  
  510. This six-digit fixed length field contains the transaction time returned by the
  511. authorizing system (HHMMSS).  The time must be printed on the receipt.
  512.  
  513. 6.0 CONFIRMATION RECORD DATA ELEMENT DEFINITIONS
  514.  
  515. The following subsections define the debit confirmation response record data
  516. elements.
  517.  
  518. 6.01 NETWORK IDENTIFICATION CODE
  519.  
  520. This one character fixed length field contains the identification code of the
  521. network on which the transaction was authorized.  The network ID is printed on
  522. the receipt.
  523.  
  524. 6.02 SETTLEMENT DATE
  525.  
  526. This four-digit fixed length field contains the transaction settlement date
  527. returned by the authorizing system.
  528.  
  529. 6.03 SYSTEM TRACE AUDIT NUMBER
  530.  
  531. This six-character fixed length field contains the system trace audit number
  532. which is assigned by the authorizing system.
  533.  
  534. 7.0 CHARACTER CODE DEFINITIONS
  535.  
  536. The following subsections will define the authorization request record character
  537. set and character sets used for track 1 and track 2 data encoded on the magnetic
  538. stripes.
  539.  
  540. The authorization request records are generated with characters defined by ANSI
  541. X3.4-1986.  The data stored on the cardholder's card in magnetic or optical form
  542. must be converted to the ANSI X3.4 character set before transmission to VisaNet.
  543.  
  544. Section 7.01 provides track 1 character set definition.  Section 7.02 provides
  545. track 2 character set definition.  Section 7.03 provides the ANSI X3.4-1986 and
  546. ISO 646 character set definitions.  Section 7.04 provides a cross reference
  547. between the track 1, track 2, and ANSI X3.4 character sets.  Section 7.05
  548. describes the method for generating and checking the Mod 10 Luhn check digit for
  549. credit card account numbers.  Section 7.06 describes the method for generating
  550. the LRC byte for the authorization request message and for testing the card
  551. swipe's LRC byte.  Section 7.07 provides sample data for an authorization
  552. request and response for record format "J" testing.
  553.  
  554. The POS device/authorization must perform the following operations on track
  555. read data before it can be used in an authorization request message.
  556.  
  557.    1. The LRC must be calculated for the data read from the track and compared
  558.       to the LRC read from the track.  The track data is assumed to be read
  559.       without errors when on character parity errors are detected and the
  560.       calculated and read LRC's match.
  561.  
  562.    2. The starting sentinel, ending sentinel, and LRC are discarded.
  563.  
  564.    3. The character codes read from the magnetic stripe must be converted from
  565.       the encoded character set to the set used for the authorization request
  566.       message.  The characters encoded on track 1 are six-bit plus parity codes
  567.       and the characters encoded on track 2 are four-bit plus parity codes, with
  568.       the character set used for the request message defined as seven-bit plus
  569.       parity codes.
  570.  
  571. All characters read from a track must be converted to the request message
  572. character set and transmitted as part of the request.  The converted track data
  573. can not be modified by adding or deleting non-framing characters and must be a
  574. one-for-one representation of the characters read from the track.  [sounds like
  575. they mean it, eh?]
  576.  
  577. 7.1 TRACK 1 CHARACTER DEFINITION
  578.  
  579. Table 7.01 provides the ISO 7811-2 track 1 character encoding definitions.  This
  580. "standards" format is a SAMPLE guideline for expected credit card track
  581. encoding; ATM/debit cards may differ.  Actual cards may differ [not], whether
  582. they are Visa cards or any other issuer's cards.
  583.  
  584. Each character is defined by the six-bit codes listed in Table 7.01.
  585.  
  586. Track 1 can be encoded with up to 79 characters as shown in Figure 7.01
  587.  
  588. +---------------------------------------------------------+
  589. |SS|FC| PAN|FS|  NAME|FS| DATE| DISCRETIONARY DATA |ES|LRC|
  590. +---------------------------------------------------------+
  591.  
  592. LEGEND:
  593.  
  594.              Field  Description                                  Length  Format
  595. --------------------------------------------------------------------------------
  596.                 SS  Start Sentinel                                 1        %
  597.                 FC  Format Code ("B" for credit cards)             1       A/N
  598.                PAN  Primary Account Number                      19 max     NUM
  599.                 FS  Field Separator                                1        ^
  600.               NAME  Card Holder Name (See NOTE below)           26 max     A/N
  601.                 FS  Field Separator                                1        ^
  602.               DATE  Expiration Date (YYMM)                         4       NUM
  603. Discretionary Data  Option Issuer Data (See NOTE below)         variable   A/N
  604.                 ES  End Sentinel                                   1        ?
  605.                LRC  Longitudinal Redundancy Check                  1
  606.                                                                   ---
  607.                     Total CAN NOT exceed 79 bytes----->           79
  608. --------------------------------------------------------------------------------
  609.  
  610.                                   FIGURE 7.01
  611.                           Track 1 Encoding Definition
  612.  
  613. NOTE: The CARD HOLDER NAME field can include a "/" as the surname separator
  614.       and a "." as the title separator
  615.  
  616.       The DISCRETIONARY DATA can contain any of the printable characters from
  617.       Table 7.01
  618.  
  619.                                    TABLE 7.01
  620.                           Track 1 Character Definition
  621.  
  622.                        b6   0   0   1   1
  623. BIT NUMBER             b5   0   1   0   1      (a) These character positions
  624. -------------------------------------------        are for hardware use only
  625. b4 b3 b2 b1    ROW/COL      0   1   2   3
  626. -------------------------------------------    (b) These characters are for
  627. 0  0  0  0        0        SP   0  (a)  P          country use only, not for
  628. 0  0  0  1        1        (a)  1   A   Q          international use
  629. 0  0  1  0        2        (a)  2   B   R
  630. 0  0  1  1        3        (c)  3   C   S      (c) These characters are
  631. 0  1  0  0        4         $   4   D   T          reserved for added
  632. 0  1  0  1        5        (%)  5   E   U          graphic use [nifty]
  633. 0  1  1  0        6        (a)  6   F   V
  634. 0  1  1  1        7        (a)  7   G   W
  635. 1  0  0  0        8         (   8   H   X      (%) Start sentinel
  636. 1  0  0  1        9         )   9   I   Y      (/) End sentinel
  637. 1  0  1  0        A        (a) (a)  J   Z      (^) Field Separator
  638. 1  0  1  1        B        (a) (a)  K  (b)      /  Surname separator
  639. 1  1  0  0        C        (a) (a)  L  (b)      .  Title separator
  640. 1  1  0  1        D         -  (a)  M  (b)      SP Space
  641. 1  1  1  0        E         -  (a)  N  (^)      +-----------------------+
  642. 1  1  1  1        F         /  (?)  O  (a)      |PAR|MSB|B5|B4|B3|B2|LSB|
  643.                                                 +-+---+-----------------+
  644.                                                   |   |--- Most Significant Bit
  645.                                                   |--- Parity Bit (ODD)
  646.                                                Read LSB First
  647.  
  648. 7.02 TRACK 2 CHARACTER DEFINITION
  649.  
  650. Table 7.02 provides the ISO 7811-2 track 2 character encoding definitions.  This
  651. "standards" format is a SAMPLE guideline for expected credit card track
  652. encoding; ATM/debit cards may differ.  Actual cards may differ, whether they are
  653. Visa cards or any other issuer's cards.
  654.  
  655. Each character is defined by the four-bit codes listed in Table 7.02.
  656.  
  657. Track 2 can be encoded with up to 40 characters as shown in Figure 7.02.
  658.  
  659. +--------------------------------------------------------+
  660. |SS|    PAN   |FS| DATE|    DISCRETIONARY DATA    |ES|LRC|
  661. +--------------------------------------------------------+
  662.  
  663. LEGEND:
  664.  
  665.              Field  Description                                  Length  Format
  666. --------------------------------------------------------------------------------
  667.                 SS  Start Sentinel                                 1     0B hex
  668.                PAN  Primary Account Number                      19 max     NUM
  669.                 FS  Field Separator                                1        =
  670. Discretionary Data  Option Issuer Data (See NOTE below)         variable   A/N
  671.                 ES  End Sentinel                                   1     0F hex
  672.                LRC  Longitudinal Redundancy Check                  1
  673.                                                                   ---
  674.                     Total CAN NOT exceed 40 bytes----->           40
  675. --------------------------------------------------------------------------------
  676.  
  677.                                   FIGURE 7.02
  678.                           Track 2 Encoding Definition
  679.  
  680. NOTE: The PAN and DATE are always numeric.  The DISCRETIONARY DATA can be
  681.       numeric with optional field separators as specified in Table 7.02.
  682.  
  683.  
  684.                                    TABLE 7.02
  685.                              Track 2 Character Set
  686.  
  687. b4  b3  b2  b1     COL              (a) These characters are for
  688. ------------------------------          hardware use only
  689. 0   0   0   0       0      0
  690. 0   0   0   1       1      1        (B) Starting Sentinel
  691. 0   0   1   0       2      2
  692. 0   0   1   1       3      3        (D) Field Separator
  693. 0   1   0   0       4      4
  694. 0   1   0   1       5      5        (F) Ending Sentinel
  695. 0   1   1   0       6      6
  696. 0   1   1   1       7      7
  697. 1   0   0   0       8      8        +---------------------------+
  698. 1   0   0   1       9      9        | PAR | MSB | b3 | b2 | LSB |
  699. 1   0   1   0       A     (a)       +---------------------------+
  700. 1   0   1   1       B     (B)          |     |
  701. 1   1   0   0       C     (a)          |     |--- Most Significant Bit
  702. 1   1   0   1       D     (D)          |--- Parity Bit (ODD)
  703. 1   1   1   0       E     (a)
  704. 1   1   1   1       F     (F)        Read LSB first
  705.  
  706. [ tables 7.03a, 7.03b, and 7.04 deleted...
  707.   If you really need a fucking ascii table that bad go buy a book.]
  708.  
  709. [ section 7.05 - Account Data Luhn Check deleted...
  710.   as being unnecessary obtuse and roundabout in explaining how the check works.
  711.   the routine written by crazed luddite and murdering thug is much clearer. ]
  712.  
  713. 7.06 CALCULATING AN LRC
  714.  
  715. When creating or testing the LRC for the read of the card swipe, the
  716. authorization request record, the debit confirmation record or the VisaNet
  717. response record; use the following steps to calculate the LRC:
  718.  
  719. 1) The value of each bit in the LRC character, excluding the parity bit, is
  720.    defined such that the total count of ONE bits encoded in the corresponding
  721.    bit location of all characters of the data shall be even (this is also known
  722.    as an EXCLUSIVE OR (XOR) operation)
  723.  
  724.       For card swipes, include the start sentinel, all the data read and
  725.       the end sentinel.
  726.  
  727.       For VisaNet protocol messages, begin with the first character past
  728.       the STX, up to and including the ETX.
  729.  
  730. 2) The LRC characters parity bit is not a parity bit for the individual parity
  731.    bits of the data message, but it only the parity bit for the LRC character
  732.    itself.  Calculated as an even parity bit.
  733.  
  734. [ i list a routine for calculating an LRC o a string later on in the document ]
  735.  
  736. 7.07 TEST DATA FOR RECORD FORMAT "J"
  737.  
  738. The following two sections provide sample data for testing record format "J"
  739. with the VisaNet dial system.
  740.  
  741. 7.07.01 TEST DATA FOR A FORMAT "J" AUTHORIZATION REQUEST
  742.  
  743. Table 7.07a provides a set of test data for record format "J" authorization
  744. request.
  745.  
  746.                                   TABLE 7.07a
  747.                         Test Data For Record Format "J"
  748.  
  749.  Test Data      Byte #   Length   Format   Field Name
  750. --------------------------------------------------------------------------------
  751.      J            1         1       A/N    Record Format
  752.  0, 2, or 4       2         1       A/N    Application Type
  753.      .            3         1       A/N    Message Delimiter
  754.    401205        4-9        6       A/N    Acquirer BIN
  755. 123456789012    10-21       12      NUM    Merchant Number
  756.     0001     *  22-25       4       NUM    Store Number
  757.     0001     *  26-29       4       NUM    Terminal Number
  758.     5999        30-33       4       NUM    Merchant Category Code
  759.     840         34-36       3       NUM    Merchant Country Code
  760.    94546        37-41       5       A/N    Merchant City Code
  761.     108         42-44       3       NUM    Time Zone Differential
  762.     54          45-46       2       A/N    Authorization Transaction Code
  763.   12345678      47-54       8       NUM    Terminal Identification Number
  764.      Y           55         1       A/N    Payment Service Indicator
  765.     0001     *  56-59       4       NUM    Transaction Sequence Number
  766.      @           60         1       A/N    Cardholder Identification Code
  767. D, H, T, or X    61         1       A/N    Account Data Source
  768.  Track or                                  Customer Data Field
  769. Manual Data
  770.     "FS"        N.A.        1       "FS"   Field Separator
  771.   0000123       N.A.      0 to 43   A/N    Transaction Amount
  772.     "FS"        N.A.        1       "FS"   Field Separator
  773.      ER         N.A.      0 or 2    A/N    Device Code/Industry code
  774.     "FS"        N.A.        1       "FS"   Field Separator
  775.                 N.A.      0 or 6    NUM    Issuing/Receiving Institution ID
  776.     "FS"        N.A.        1       "FS"   Field Separator
  777.     000         N.A.      3 to 12   NUM    Secondary Amount (Cashback)
  778.     "FS"        N.A.        1       "FS"   Field Separator
  779. --------------------------------------------------------------------------------
  780.  
  781. NOTE:* Denotes fields that are returned in the response message
  782.  
  783. 7.07.2 RESPONSE MESSAGE FOR TEST DATA
  784.  
  785. Table 7.07b provides the response message for the test data provided in section
  786. 7.07.1.
  787.  
  788.                                   TABLE 7.07b
  789.                Response Message For Test Data - Record Format "J"
  790.  
  791.  Test Data      Byte #   Length   Format   Field Name
  792. --------------------------------------------------------------------------------
  793. A, Y, N, or   *   1        1       A/N     Payment Service Indicator
  794.  "space"
  795.    0001       *  2-5       4       NUM     Store Number
  796.    0001       *  6-9       4       NUM     Terminal Number
  797.     5         *   1        1       A/N     Authorization Source Code
  798.    0001       * 11-14      4       NUM     Transaction Sequence Number
  799.     00        * 15-16      2       A/N     Response Code
  800.   12AB45      * 17-22      6       A/N     Approval Code
  801.   111992      * 23-28      6       NUM     Transaction Date (MMDDYY)
  802. AP ______       29-44      16      A/N     Authorization Response Message
  803. 0, Sp, or "FS"   45        1       A/N     AVS Result Code
  804.               *Variable  0 or 15   NUM     Transaction Identifier
  805.     "FS"                           "FS"    Field Separator
  806.               *Variable  0 or 4    A/N     Validation Code
  807.     "FS"                           "FS"    Field Separator
  808. --------------------------------------------------------------------------------
  809. NOTE: * Move to data capture record for VisaNet Central Data Capture (CDC)
  810. --------------------------------------------------------------------------------
  811.  
  812.                                 [ section two ]
  813.                               [ finding visanet ]
  814.  
  815. finding visanet isn't hard, but it can be tedious.  visanet rents time off of
  816. compuserve and X.25 networks.  the compuserve nodes used are not the same
  817. as their information service, cis.  to identify a visanet dialup after
  818. connecting, watch for three enq characters and a three second span to hangup.
  819. if you've scanned out a moderate portion of your area code, you probably have a
  820. few dialups.  one idea is to write a short program to dial all the connects you
  821. have marked as garbage or worthless [ you did keep em, right? ]  and wait
  822. for the proper sequence.  X.25 connections should work similarly, but i don't
  823. know for sure.  read the section on visanet usage for other dialup sources.
  824.  
  825.                                 [ section three ]
  826.                         [ visanet link level protocol ]
  827.  
  828. messages to/from visanet have a standard format:
  829.  
  830.     stx - message - etx - lrc
  831.  
  832. the message portion is the record formats covered in section one.  lrc values
  833. are calculated starting with the first byte of message, going up to and
  834. including the etx character.  heres an algorithm that calculates the lrc for a
  835. string. note: in order to work with the visanet protocols, append etx to the
  836. string before calling this function.
  837.  
  838. unsigned char func_makelrc(char *buff)
  839. {
  840.    int i;
  841.    char ch, *p;
  842.  
  843.    ch = 0;
  844.    p = buff;
  845.  
  846.    for(;;)  {
  847.       ch = (ch^(*p));
  848.       p++;
  849.       if(!(*p))
  850.          break;
  851.    }
  852.  
  853.    return ch;
  854. }
  855.  
  856. for a single authorization exchange, the easiest kind of transaction, the
  857. sequence goes like this:
  858.  
  859. host   enq                   stx-response-etx-lrc   eot
  860. term      stx-request-etx-lrc                    ack
  861.                                                           <disconnect>
  862.  
  863. matching this sequence with test record formats from section one, 7.07, heres
  864. an ascii representation of a transaction.  control characters denoted in <>'s.
  865. [of course, you wouldn't really have a carriage return in middle of a message.
  866. duh. ]  this transaction would be for card number 4444111122223333 with an
  867. expiration date of 04/96.  the purchase amount is $1.23.  visanet responds with
  868. an approval code of 12ab45.
  869.  
  870. host: <enq>
  871.  
  872. term: <stx>J0.401205123456789012000100015999840945461085412345678Y0001@H444411
  873.       1122223333<fs>0496<fs>0000123<fs>ER<fs><fs>000<fs><etx><lrc>
  874.  
  875. host: <stx>Y00010001500010012AB45111992APPROVAL 12AB45123456789012345<fs>
  876.       ABCD<fs><etx><lrc>
  877.  
  878. term: <ack>
  879.  
  880. host: <eot>
  881.  
  882. authorizing multiple transactions during one connect session is only slightly
  883. more complicated.  the etx character on all messages sent to visanet are changed
  884. to etb and the application type is changed from '0' to '2' [section one 4.02].
  885. instead of responding after a transaction with eot, visanet instead polls the
  886. terminal again with enq.  this continues until the terminal either changes back
  887. to the single transaction format or issues an eot to the host.
  888.  
  889. heres a short list of all control characters used:
  890.  
  891. stx: start-of-text, first message framing character signaling message start
  892. etx: end-of-text, the frame ending character the last message of a sequence
  893. eot: end-of-transmission, used to end an exchange and signal disconnect
  894. enq: enquiry, an invitation to transmit a message or retransmit last item
  895. ack: affirmative acknowledgment, follows correct reception of message
  896. nak: negative acknowledgment, used to indicate that the message was not
  897.      understood or was received with errors
  898. syn: delay character, wait thirty seconds
  899. etb: end-of-block, the end framing character used to signal the end of a message
  900.      within a multiple message sequence
  901.  
  902. other quick notes: visanet sometimes sends ack before stx on responses
  903.                    lrc characters can hold any value, such as stx, nak, etc
  904.                    visanet can say goodbye at any time by sending eot
  905.                    people can get very anal about error flow diagrams
  906.  
  907.                                 [ section four ]
  908.                     [ half the story; central data capture ]
  909.  
  910. a full transaction requires two steps, one of which is described in this
  911. document: getting the initial authorization.  an authorization does basically
  912. nothing to a person's account.  oh, you could shut somebody's account down for
  913. a day or two by requesting a twenty thousand dollar authorization, but no other
  914. ill effects would result.  central data capture, the second and final step in a
  915. transaction, needs information from both the authorization request and
  916. response, which is used to generate additional data records.  these records are
  917. then sent to visanet by the merchant in a group, usually at the end of each day.
  918.  
  919.                                 [ section five ]
  920.                             [ common applications ]
  921.  
  922. access to visanet can be implemented in a number of ways: directly on a pos
  923. terminal, indirectly via a lan, in a hardware specific device, or any
  924. permutation possible to perform the necessary procedures.  card swipers commonly
  925. seen at malls are low tech, leased at around fifty dollars per month, per
  926. terminal.  they have limited capacity, but are useful in that all of the
  927. information necessary for transactions is self contained.  dr delam and maldoror
  928. found this out, and were delighted to play the role of visanet in fooling the
  929. little device.  close scrutiny of section one reveals atm formats, phone order
  930. procedures, and new services such as direct debit from checking/savings and
  931. checks by phone.  start noticing the stickers for telecheck and visa atm cards,
  932. and you're starting to get the picture.
  933.  
  934.                                [ section seven ]
  935.                               [ brave new world ]
  936.  
  937. could it be?  yes, expiration dates really don't matter....
  938. this article written to thank previous Phrack writers...
  939. please thank me appropriately...
  940. 800#s exist...
  941. other services exist... mastercard runs one...
  942. never underestimate the power of asking nicely...
  943. numerous other formats are available... see section one, 3.0 for hints...
  944. never whistle while you're pissing...