St. George IPG file specification
This page describes the St.George IPG file format that PayWay Batch accepts. It details the payment file format (containing card details and amounts to charge), and the report file format.
File format
All files are plain text using the US-ASCII character encoding. Records are separated by the CR LF end-of-line marker. Fields within each record are separated by commas, as per the industry standard Comma Separated Value (CSV) format. Any field values that contain commas must be surrounded by double-quotes, e.g. "A field value, including comma".
Data types are listed as:
N
- numeric 0-9 onlyD
- numeric 0-9 with a decimal pointA
- letters from the English alphabetAN
- letters or numbers (alphanumeric)S
- spaces only
IPG payment file
The payment file has the following general structure:
- Comments (optional)
- Batch ID line (required)
- Sale/Refund transactions
Comments
Any line that begins with double slash // is considered a comment. These lines will be ignored by PayWay.
Batch ID Line
The first non-comment line in the file must be the batch ID. This is enclosed in XML-like tags as follows:
<batchid>2010092701</batchid>
The batch ID must be unique for each file you submit. You can set the batch ID to the current date plus a sequence number.
Payment file transaction
Each batch contains one or more sale or refund transactions.
No | Field Name | Max Length | Data Type | Description |
---|---|---|---|---|
1 | Transaction Type | 1 | A |
C - sale (aka credit), R - refund, P - pre-authorisation, M - capture (aka completion) |
2 | Merchant ID | 8 | N |
8-digit merchant ID number allocated by Westpac/St. George. Only one merchant ID can be used per batch. Use TEST for a test-only facility. |
3 | Merchant Reference Number | 20 | AN |
Your first reference number for this transaction. Populate this field with your system's identifier for this transaction to allow tracing. |
4 | Card Number | 19 | N |
Card number. Do not include dashes or spaces between the card number digits. |
5 | Card Expiry Date | 4 | N |
The card expiry date in MMYY format. Leading zeroes must be included. |
6 | Filler | 0 | Empty field for backwards compatibility. | |
7 | Transaction Amount | 10 | D |
Transaction amount in dollars and cents. For example, $125.94 is expressed as 125.94 . If you have enabled surcharges in the PayWay website, PayWay will add a surcharge to this amount. Using the above example, if you have a 1% surcharge, PayWay will add $1.26 to the transaction amount. |
8 | Original Transaction Reference | 20 | N |
Blank for sale and pre-auth. For refund, this is the PayWay receipt number of the original purchase that is being refunded. For capture, this is the PayWay receipt number of the original pre-auth that is being captured. |
9 | Authorisation Code | 6 | AN |
If capturing a previous pre-auth transaction, this is the 6 character authorisation code from that pre-auth transaction. Otherwise, leave blank. |
10 | Merchant Comment | 20 | AN |
An optional comment for the transaction, such as the cardholder's name. This field will be ignored by PayWay. |
Note:
- The Sale Type of
R
for Recurring transaction (ie MasterCard or Visa Recurring) should be set if a transaction is a recurring transaction for which you hold a valid direct debit agreement from the cardholder. In addition, for Visa Recurring, the first transaction has to be authorised with a valid card expiry date. If the transaction is a one-off transaction, you must set the Sale Type to one of the other given values (i.e.M
,T
orE
). Under no circumstances may you flag a one-off transaction as Recurring. - Refunds are a potential avenue for fraud. Check your merchant agreement for information about performing refunds.
Report file
The report file rejects file contains the list of all transactions that were processed. The file has the following general structure:
- 3 header lines
- Blank line
- Table header line
- Transaction lines (one or more in each file)
Report header lines
The first 3 lines in the report file will be as follows:
PayWay Batch Report.
Client 10000001. Batch ID 2010092701
Date of report Mon Sep 27 10:00:01 EST 2010
Table header line
This comma separated line lists the transaction field headings:
clientid
referencenumber
carddata
expirydate
amount
merchantrefcode
txnreference
authcode
settlement
responsetext
responsecode
error
Report transaction
Each record represents a transaction that was declined during processing.
No | Field Name | Max Length | Data Type | Description |
---|---|---|---|---|
1 | Transaction Type | 1 | A |
Same as the value specified in the payment file. |
2 | Merchant ID | 8 | N |
Same as the value specified in the payment file. |
3 | Merchant Reference Number | 20 | AN |
Your reference number from the payment file. |
4 | Masked Card Number | 19 | AN |
The first 6 and last 3 digits will be present in the form: xxxxxx...xxx |
5 | Card Expiry Date | 4 | N |
Same as the value specified in the payment file. Format: MMYY |
6 | Transaction Amount | 12 | D |
Transaction amount in dollars and cents with a dollar sign. For example, $125.94 is expressed as $125.94 . If you have enabled surcharges in the PayWay website, this will be the amount before the surcharge was applied. |
7 | Filler | 0 | AN |
Empty field for backwards compatibility. |
8 | PayWay Receipt Number | 20 | N |
PayWay's receipt number. Same as the value specified in the payment file. |
9 | Authorisation Code | 6 | AN |
If the transaction a pre-auth and it was approved, the 6-character authorisation code will appear here. |
10 | Settlement Date | 11 | AN |
The transaction settlement date in dd MON yyyy format (e.g. 27 Sep 2010 ) |
11 | Response Text | 100 | AN |
The text associated with the response code received from processing (e.g. "Honour with identification"). |
12 | Response Code | 2 | AN |
The response code received from processing (e.g. 08 ). |
13 | Error Text | 100 | AN |
The text of any processing errors that occurred, or blank if no errors occurred. |