13.01.2013 Views

Connecting to PaymentTrust's Secure Transaction Network - WorldPay

Connecting to PaymentTrust's Secure Transaction Network - WorldPay

Connecting to PaymentTrust's Secure Transaction Network - WorldPay

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7 DEVELOPMENT<br />

Developing for STLink and STN<br />

This section outlines guidelines and sample code for communicating with STLink. Code<br />

fragments are shown for the more common programming environments.<br />

The supplied strings are only examples and do not represent real strings. Any URLs that are<br />

referenced are valid at the point of this document’s creation and may change at any time.<br />

Requests may be submitted in XML. XML responses will be returned. Submitted code will differ<br />

only in that submitted string requests will be in XML format suggested by PaymentTrust Ltd..<br />

All transaction requests must be submitted <strong>to</strong> STLink and all batch requests <strong>to</strong> STLink Batch.<br />

Both STLink and STLink Batch accept the HTTP and HTTPS pro<strong>to</strong>cols, though it is<br />

recommended that the HTTPS pro<strong>to</strong>col be used <strong>to</strong> safely transmit the requests via the Internet.<br />

All requests must be submitted using the HTTP POST method. The POST method works by<br />

supplying key/value pairs, where the key and value are split by the “=” symbol and key/value<br />

pairs by the “&” symbol. For instance: key1=some value&key2=some value... In the case of<br />

STLink, there is one key value pair. The key is StringIn and the value is any transaction type<br />

outlined in section 6.1.<br />

Example Q request (Non XML):<br />

StringIn=VersionUsed^1~MerchantId^100000~UserName^Mariah~UserPassword^rr87uy~<strong>Transaction</strong>Type^<br />

Q~IsTest^1~TimeOut^60000~BatchId^938344376~<br />

Example Q request (XML):<br />

StringIn=1100000Mariahrr87uyQ190000938344376<br />

Though STLink Batch accepts POST requests, it is important <strong>to</strong> note that the StringIn key is not<br />

required and must not be submitted <strong>to</strong> the STLink Batch for batch requests. If not the batch<br />

request will be rejected for reason of being a malformed XML document.<br />

The “=” and “&” symbols are standard characters used in the HTTP pro<strong>to</strong>col <strong>to</strong> separate<br />

key/value pairs, there fore it is important that no “=” and “&” symbols be found in the transactions,<br />

although this can be overcome by escaping all characters after the StringIn key by using URL<br />

encoding. URL encoding allows the “=”, “&” and other HTTP characters <strong>to</strong> be included in the<br />

transaction.<br />

Example:<br />

StringIn=<br />

Because STLink Batch does use the StringIn key, the batch request must not be URL encoded. If<br />

not the batch request will be rejected for reason of being a malformed XML document.<br />

XML has its own encoding rules. For 0ne, the STLink and STLink Batch will support any XML<br />

document that has been encoded in an 8-bit ANSI character set, such as: ISO-8859-1. Second of<br />

all XML has its own share of “special” characters. If any of these characters are <strong>to</strong> be included<br />

within the data of a specified transaction tag, they <strong>to</strong> must be escaped. The table below lists<br />

those characters and their escape sequence.<br />

263

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!