Select Batch

Use of Web-Merchant/WM Select in batch mode is an extension of the Select Invisible mechanism for one-shot instant purchases and refunds, and precisely the same functions are provided, subject to authorisation.

This document should be read in conjunction with the following other pages:

Batch file format

After any mail headers have been stripped, and wrappings (such as PGP) removed, the body of a batch file consists of lines as follows (note that all active content must start in the first column of the line):

If a line (typically setting a parameter) ends with the character \ the following line is considered to be a continuation of the value, with the \ removed but the newline preserved.

You should normally set the parameter literalResult to describe the format in which Select should return the results of each request. This can contain text, newlines (preceded by \), and variable substitutions. Substitutions should be specified in the same format used by other Select template files, eg:

<WPDISPLAY ITEM="parameter" DEFAULT="default" PRE="pre" POST="post">
As a convenience, the abbreviated syntax <<parameter>> is expanded to <WPDISPLAY ITEM="parameter">, but note that in this case unset parameters will always be displayed as #null#, and embedded substitutions are not available. The magic token <<#>> is replaced with an integer sequence number identifying the request within the batch (starting with 1).

With the exception of the << >> syntax, values are carried unaltered into the Select processing engine. In particular, 'URL-encoding' should not be used anywhere in the batch file: eg. multi-line postal addresses should be sent as multiple lines joined by \, or condensed with commas into a single line.

For complicated result formats, you may prefer to upload a template file and specify it with the parameter resultFile instead. However, uploaded files cannot use the << >> syntax.

Example


instId:=12345
testMode:=0
authPW:=mypassword
literalResult:=<<#>>,<<cartId>>,<<transStatus>>,<<transId>>,<<rawAuthMessage>>
This is batch 55

cartId=my-trans-id-987654
cardName=Joe Bloggs
address=1 High Street, Anytown
postcode=AY1 0AA
country=GB
email=joe@bloggs.org
cardNo=4936000011112222
cardStartMonth=01
cardStartYear=1998
cardExpMonth=12
cardExpYear=2002
cardIssueNo=1
amount=19.99
currency=GBP
go
#
cartId=my-trans-id-555333111
cardName=Jane Smythe
address=2 High Street, Othertown, New York
postcode=64321-9942
country=US
email=jane@smythe.com
cardNo=492977755544421
cardStartMonth=01
cardStartYear=1996
cardExpMonth=12
cardExpYear=1998
amount=1.00
currency=USD
go
#
op=refund-full
transId=156001
might result in the following response:

This is batch 55

1,my-trans-id-987654,Y,157240,AUTH CODE: 00951
2,my-trans-id-555333111,N,-1,Card has expired
3,#null#,Y,157242,ACCEPTED

Back to contents page

$Revision: 1.4 $