Capms MD
Capms MD
Capms MD
3700 POS
CA/EDC PMS Interface Specifications Manual
Copyright 2000-2002
MICROS Systems, Inc.
Columbia, MD USA
All Rights Reserved
Declarations
Warranties
Although the best efforts are made to ensure that the information in this
manual is complete and accurate, MICROS Systems, Inc. makes no
warranty of any kind with regard to this material, including but not limited
to the implied warranties of marketability and fitness for a particular
purpose. Information in this manual is subject to change without notice.
MICROS Systems, Inc. shall not be liable for errors contained herein or for
incidental or consequential damages in connection with the furnishing,
performance, or use of this manual.
Non-Disclosure Statement
Information contained in this manual is proprietary and therefore is only
intended for use by MICROS installers, and third-party programmers, who
may use it to develop custom reports, etc. This information must not be
disclosed to MICROS competitors without the express written consent of
MICROS Systems, Incorporated.
Printing History
New editions of this manual incorporate new and changed material since
the previous edition. Minor corrections and updates may be incorporated
into reprints of the current edition without changing the date or the edition
number.
ii
Table of Contents
Table of Contents
Why Read This Manual? ............................................................................................................... v
How This Manual is Organized .................................................................................................. vi
Overview of CA/EDC PMS Interface .......................................................................................... 1
Message Formats ............................................................................................................................ 2
POS Source ID Segment ..................................................................................................... 2
Applications Sequence Segment ......................................................................................... 3
Applications Data Segment ................................................................................................. 3
Checksum Field................................................................................................................... 4
Interfaces......................................................................................................................................... 5
Asynchronous Serial Interface ............................................................................................ 5
TCP Interface ...................................................................................................................... 6
Messages .......................................................................................................................................... 7
Messages Fields .................................................................................................................. 7
Field Types and Sizes .......................................................................................................... 7
Message Types .................................................................................................................... 8
Credit Authorization Process .............................................................................................. 9
Batch Settlement Process .................................................................................................. 12
Interface Considerations.............................................................................................................. 21
Full Duplex Messages ....................................................................................................... 21
Multiple Authorization Requests From a Workstation ..................................................... 21
Redundant Connections .................................................................................................... 21
Charge Backs and Credit Card Inquiries........................................................................... 21
ABA Track 1 Information ................................................................................................. 21
Zero Payment Records ...................................................................................................... 22
Appendix ....................................................................................................................................... 23
iv
Why Read This Manual?
Purpose
The 3700 CA/EDC PMS Interface Specification Manual provides the
information necessary to develop a communication interface between the
PMS and the MICROS 3700 System for the purpose of performing Credit
Authorization and Settlement procedures.
Interface Overview
This section contains a brief description of the CA/EDC PMS Interface and
its features.
Message Formats
This section describes the message formats for asynchronous serial and
TCP connections.
Interfaces
This section describes the two interfaces that are supported by the 3700
CA/EDC: the traditional asynchronous serial interface and a TCP-based
interface.
Messages
This section explains message field types and sizes.
Interface Considerations
This section describes certain features that should be considered when
designing a CA/EDC PMS Interface.
Appendix
This appendix provides sample code for the CA/EDC PMS Interface.
vi
Overview of CA/EDC PMS Interface
Message Formats
The message formats for both asynchronous serial and TCP connections
are the same. They are sent by both the 3700 and the PMS, and include
three segments:
The segments are enveloped using the standard ASCII control characters:
SOH (01H), STX (02H), ETX (03H), and EOT (04H). Also, IBM PC
character codes and an ASCII superset are used throughout to provide
support for international characters.
POS User Workstation 2 or 9 Bytes 2 or 9 ASCII Digits The format (2 or 9) will depend
Number on the 3700 configuration. It may
contain leading spaces or zeros
and is between 1 and 99 or 1
and 999999999.
2
Message Formats
Checksum Field
The Checksum field is only used when communicating over the
asynchronous serial interface. In the case of TCP interfaces, this field is
ignored and may be omitted. When the Checksum is used, it should be
formatted as follows:
The Checksum is initially set to zero and is the 16-bit binary addition
(excluding parity if applicable) of all characters after, but not including, the
SOH character and through (and including) the ETX character. The
Checksum is then represented as four ASCII-Hex character for
transmission.
4
Interfaces
Interfaces
The 3700 CA/EDC supports two interfaces: the traditional asynchronous
serial interface and a TCP-based interface.
Pinging
Both the Asynchronous Serial Interface and the TCP Interface (described
on the following page) have a “keep alive” time-out which is typically in
the order of two hours. To detect a “down” interface more quickly and re-
establish the connection, the CA/EDC Interface will periodically (typically
every five minutes) send a “ping” message to the server. The ping message
is formatted as:
The POS ID source segment will contain a null address (the POS User
Workstation number will be zero and the interface name will contain
spaces). The server should detect the message and return it “as is.”
TCP Interface
This interface is designed to be used by Windows and other systems that
are connected using TCP/IP. This interface is LAN-independent and
supports Ethernet, Token Ring, FDDI, Arcnet, PPP, and others. In addition,
this interface may be used by applications that reside on the same Windows
platform as the 3700.
TCP Connection
The CA/EDC Interface connects to the TCP port as a client. The server
should accept TCP connections from the 3700 POS client on port “micros-
ca.” If this service is not defined, port number 5008 should be used as the
default. The CA/EDC messages are formatted as:
The Checksum field is ignored and may be omitted in both cases, so that
the EOT character may immediately follow the ETX character.
6
Messages
Messages
This section describes message fields as well as field types and sizes.
Message Fields
Message fields are separated by ASCII File Separator characters (FS-1CH).
The PMS Interface software should access fields by parsing field separators
to find the start of each field. Since fields are not of a fixed length, their
absolute position within a message cannot be guaranteed. When a field is
omitted (because it is either optional or not applicable), the field separator
must still be present.
Field
Abbreviation Maximum Field Length Description and Remarks
Type
Numeric Nx x bytes plus an addi- These fields are used for numeric information
tional byte for minus sign and may comprise x digits.
if negative Example: N4 supports -9999 to 9999
Leading spaces should be suppressed.
Amount $x x bytes plus additional These fields are used for monetary amounts.
bytes for decimal point They will include a decimal point and may be
and minus sign if nega- preceded by a minus sign. They may comprise
tive x digits.
Example: $4 in the US will support -99.99 to
99.99
Leading spaces should be suppressed.
Message Types
The interface supports two categories of messages; those provided to
support the Credit Authorization process and those provided to support the
draft capture or batch settlement process. Typically, authorizations will
occur while food service or retail outlets are open. Depending upon the
installation, these may be open 24 hours a day and therefore require that
Credit Authorization be supported at all times.
Draft capture will most often occur once a day, usually during the “end of
day” process. This interface is designed to allow authorizations to occur
while batch settlement is taking place. However, a facility is also provided
to prevent simultaneous processing for those PMS Systems that cannot
support it.
Batch Open BO_RSP PMS Message acknowledging the start of a new batch.
Response
Batch Close BC_REQ 3700 Message requesting that the current batch be
Request closed.
Batch Close BC_RSP PMS Message acknowledging the closure of the current
Response batch.
Batch Inquiry BI_REQ 3700 Message requesting information about the current
Request batch.
Batch Inquiry BI_RSP PMS Message providing information about the current
Response batch.
8
Messages
Merchant ID A16 Contains the Merchant ID associated with this outlet or Reve-
nue Center.
Card Info Format N1 Indicates the format of the credit card information:
1 = ABA track 2 information
2 = ABA track 2 information and guest name field
3 = Manually entered credit card information
4 = Manually entered credit card information with issue number
and start date
Note: Only one set of fields will appear in each message.
Track 2 Card Info A40 ABA specified format including start sentinel (3BH), field sepa-
rator (3DH), and end sentinel (3FH). This field is only present if
the card information is format 1 or 2.
Guest Name A26 Guest name as read from ABA track 1. This field is only
present if the card information is format 2.
Manually Entered Info – N19 Manually entered credit card account number. This field only
Account Number appears if the card information is format 3.
Manually Entered Info – N4 Expiration date formatted as MMYY. This field is only present if
Expiration Date the card information is format 3.
Manually Entered Info – A2 The issue number of the credit card presented for authoriza-
Issue Number1 tion. This field is only present if the driver is configured to
include it (card information is format 4).
Manually Entered Info – N4 The start date of the credit card presented for authorization.
Start Date1 This field is only present if the driver is configured to include it
(card information is format 4).
Guest Check Number2 N6 Guest check number associated with the transaction.
1
These fields will be empty if Ops is not configured to prompt for them. (POS Configurator | Sales |
Tender/Media | CC Tender | Prompt for...).
2These fields are only transmitted when the Dollars in the Bank (DITB) option is enabled on the
CA/EDC Drivers | System tab in POS Configurator.
10
Messages
Message A32 Ignored if left blank. This may be used with any response. Typi-
cally used to describe the reason for a decline or a referral. It
may also be used with an approval, in which case the operator
must read the message before continuing.
PMS Discretionary Data A32 May be used to store discretionary information. It is returned to
the PMS during the batch settlement process. Typically, it is
used for storing PS2000-related data elements.
There are two batch settlement methods available. If the CA/EDC Interface
is configured for host-based settlement, every record will be marked as
“settled” in the Credit Card Batch immediately following settlement.
12
Messages
MICROS
PMS Notes
3700
BX_REQ
BX_RSP
After all payment records are transferred,
the batch is closed.
BC_REQ
BC_RSP
In the event the batch settlement process fails, the Batch Inquiry message
is used to recover. An example is provided below.
MICROS
PMS Notes
3700
BX_REQ
BX_RSP
14
Messages
If a batch is already open and has associated records, it should be left open
and the number and value of these records should be returned. If no batch
is open, one should be started and the record count and value should be
reset. An error should only be returned if it is not possible to begin the
Settlement process. Please note that if a batch is already open, the 3700
application will report the total (including any existing records) at the end.
Number of Records N5 Contains the number of records currently in the open PMS
batch. This field is only present if the status is 2.
Record Value $10 Contains the value of the records currently in the open PMS
batch. This field is only present if the status is 2.
Failure Message A32 Contain a message describing the nature of the failure. This
field is only present if the status is 3.
Merchant ID A16 Contains the Merchant ID associated with this outlet or Reve-
nue Center.
Revenue Center Type A2 Contains an arbitrary 2-character field denoting the outlet type
(restaurant, bar, retail, etc.).
Card Info Format N1 Indicates the format of the credit card information:
1 = ABA track 2 information
2 = ABA track 2 information and guest name field
3 = Manually entered credit card information
4 = Manually entered credit card information with issue number
and start date
Note: Only one set of fields will appear in each message.
Track 2 Card Info A40 ABA-specified format including start sentinel (3BH), field sepa-
rator (3DH), and end sentinel (3FH). This field is only present if
the card information is format 1 or 2.
Guest Name A26 Guest name as read from ABA track 1. This field is only
present if the card information is format 2.
Manually Entered Info – N19 Manually entered credit card account number. This field only
Account Number appears if the card information is format 3.
Manually Entered Info – N4 Expiration date formatted as MMYY. This field is only present if
Expiration Date the card information is format 3.
Manually Entered Info – A2 The issue number of the credit card presented for authoriza-
Issue Number1 tion. This field is only present if the driver is configured to
include it (card information is format 4).
Manually Entered Info – N4 The start date of the credit card presented for authorization.
Start Date1 This field is only present if the driver is configured to include it
(card information is format 4).
Payment Amount $8 The payment amount including tip. This may be zero — refer to
the “Interface Considerations” section.
1
These fields will be empty if Ops is not configured to prompt for them. (POS Configurator | Sales |
Tender/Media | CC Tender | Prompt for...).
16
Messages
1st Authorization Code A6 The code associated with the first authorization.
Note: This field will not be presented if there were no authoriza-
tions.
Discretionary Data A32 Discretionary data (e.g., PS2000) associated with the first
Associated with the 1st authorization.
Authorization Note: This field will not be present if there were no authoriza-
tions.
2nd Authorization Code A6 The code associated with the second authorization.
Note: This field will not be presented if there was no second
authorization.
Discretionary Data A32 Discretionary data (e.g., PS2000) associated with the second
Associated with the 2nd authorization.
Authorization Note: This field will not be presented if there was no second
authorization..
Revenue Center Num- N3 The revenue center in which the payment was performed.
ber
Failure Message A32 Contain the reason for the failure. This field will only be present
when a batch transfer fails.
18
Messages
Number of Records N5 Contains the number of records in the closed batch. The field is
only present if the status is 1.
Record Value $10 Contains the value of the records currently in the closed PMS
batch. The field is only present if the status is 1.
Failure Message A32 Contain a message describing the nature of the failure. This
field is only present if the status is 2.
The 3700 application software will report the value and number of records
in the closed batch.
Number of Records N5 Contains the number of records currently in the open or last
PMS batch.
Record Value $10 Contains the value of the records currently in the open or last
PMS batch.
The Batch Inquiry command may be sent at any time and used during
diagnostics to troubleshoot Settlement problems.
20
Interface Considerations
Interface Considerations
When designing the interface between the 3700 and PMS Systems, the
following features should be considered.
Redundant Connections
The 3700 supports redundant connections to maximize system availability
through Backup Server Mode (BSM).
The PMS System may use these zero payment records to cancel an existing
authorization record or to clear a customer’s credit for the amount of the
authorization.
22
Appendix
Appendix
This appendix includes sample code designed for the CA/EDC PMS
Interface.
/*
* MICROS CA/PMS TCP Server
*
* This code implements a server process that accepts CA/PMS messages
* from the MICROS CA/PMS driver, which acts as client process over a
* TCP link.
* This sample code is written for UNIX System V using the AT&T SVID
* Transport Layer Interface (TLI) API. It should be easily portable
* to the X/Open Transport Interface (XTI). Porting to a
* Berkeley-style socket library is left as an exercise for the
* reader.
*
*/
#include <stdio.h>
#include <fcntl.h>
#include <signal.h>
#include <sysexits.h>
#include <sys/types.h>
#include <netdb.h>
#include <tiuser.h>
#include <stropts.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/netinet/in.h>
/* supplied by vendor: */
extern void process_pos_request (const char *header,
const char *body,
char reply_body [MAX_MSG_BODY]);
/* supplied below: */
static void transfer_pos_messages (int fd);
retries = 10;
while (retries--) {
24
Appendix
if (sin->sin_port != serviceport) {
fprintf(stderr,
“run_server: wanted port %d, got port %d, retrying\n”,
ntohs(serviceport), ntohs(sin->sin_port));
t_close(listen_fd);
t_free((char *)bind, T_BIND);
sleep(10);
}
else
break;
if (retries == 0) {
fprintf(stderr, “run_server: could not get port %d\n”,
ntohs(serviceport));
t_close(listen_fd);
exit(EX_TEMPFAIL);
}
sigignore(SIGCLD);
while (1) {
26
Appendix
switch(fork()) {
default: /* parent */
close(conn_fd);
break;
case 0: /* child */
t_close(listen_fd);
transfer_pos_messages(conn_fd);
exit(EX_OK);
break;
}
}
}
}
#define SOH 1
#define STX 2
#define ETX 3
#define EOT 4
#define ACK 6
#define NAK 21
state = msg_begin;
msg_buf_len = 0;
while (1) {
if (n < 0) {
perror(“transfer_pos_messages: read”);
close(fd); /*this connection is finished */
return;
}
if (n == 0) {
fprintf(stderr, “transfer_pos_messages; connection closed\n”);
close(fd); /* this connection is finished */
return;
}
switch(recv_buff[i]) {
case SOH:
if(NEXT_STATE(msg_begin, msg_id)) {
/* Restart message, and, for clarity,
* remember the position of the (upcoming) first
* byte of the header.
28
Appendix
*/
msg_buf_len = 0;
header = &msg_buf[msg_buf_len];
}
else
STATE_ERROR
break;
case STX:
if(NEXT_STATE(msg_id, msg_data)) {
/* NUL-terminate header, and remember the position
* of the (upcoming) first byte of the body
*/
msg_buf[msg_buf_len++] = ‘\0’;
body = &msg_buf[msg_buf_len];
}
else
STATE_ERROR
break;
case ETX:
if (NEXT_STATE(msg_dta, msg_cksum)) {
/* NUL-terminate the body. */
msg_buf[msg_buf_len++] = ‘\0’;
}
else
STATE_ERROR
break;
case EOT:
if (NEXT_STATE(msg_cksum, msg_begin)) {
int_reply_len;
reply_body[0] = ‘\0’;
/* If body exists,
* send request to CA/PMS-specific code.
* header[0] through NUL is the header.
* body[0] through NUL is the request body.
* reply_body[0] through NUL will be the
* reply body.
* (If body is empty, return empty response to POS.)
*/
if body[0] != ‘\0’)
process_pos_request(header, body, reply_body);
sprintf(reply_buf, “%c%s%c%s%c%c”,
SOH, header, STX, reply_body, ETX, EOT);
reply_len = strlen(reply_buf);
if (write(fd, reply_buf, reply_len) != reply_len {
perror(“transfer_pos_messages: write”);
close(fd);
return;
}
}
else
STATE_ERROR
break;
case ACK:
case NAK:
/* Ignore ACKs and NAKs */
break;
default:
switch(state) {
case mag_begin:
case mag_cksum:
default:
break;
case mag_id:
case msg_data;
msg_buf[msg_buf_len++] = recv_buf[i];
break;
break;
}
break;
}
}
}
}
30