Secure Trading API

The Secure Trading API is our service for merchants who want to use their own secure servers, but wish to use Secure Trading’s payment network as part of their own e-commerce application. It has all the capabilities of SecureTrading STPP Payment Pages, but in addition you can use our service in a more sophisticated way.

Using SecureTrading API you can:

  • Automate refunds and authorisation reversals, and control the settlement schedule for each transaction.
  • Have development capability and write applications that can process payments.
  • Integrate a payment solution into back-office or legacy systems.

For more information please contact our support team on 01248 672050.

Is it possible to run concurrent versions of Secure Trading API at the same time on the same server?

If you wish to run concurrent Secure Trading API clients on the same server, you will need to specify a different port in your stapi.ini file for one of them. Both Secure Trading API clients will use the same certificate files.

Error Message: XML: org.xml.sax.SAXParseException: Premature end of file.

Firstly, ensure there is a new line at the end of the XML request when it is being sent to us as Secure Trading API will only read complete lines. Also ensure all your XML tags are well formed (e.g. opened and closed appropriately) and nested tags are fully enclosed within other tags. This error could also be returned if the XML used contains uppercase letters (even in the XML tags), or if you are passing spaces somewhere in the XML.

Error Message: Request aborted: Unable to send to gateway javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure.

This may indicate there is a problem with the certificates. Ensure that the certificates you have received from Secure Trading have not been corrupted in any way (for example, accidentally editing characters in the file). Try following the import phase again (section 3.3 Certificate Import of User Guide). You may need to restart the Secure Trading API Client to pick up any changes made.

What formats do you process currencies in?

We use base values in currency i.e. no decimal places. To clarify, along with the relevant currency codes, you should send the values in the format of the examples below.
£100.00 would be 10000 and £100.50 would be 10050
$100.00 would be 100000 and $125.25 would be 12525
For those currencies that have only single units, such as Japanese Yen (JPY), then for ¥1, you would send 1. ¥4050 needs to be sent as 4050 – if you pass it as 405000, then you will process ¥405000.

I am getting a 30000 FieldError for a field I do not want validated (e.g. telephone number or email address).

We recommend allowing your customers to correct any invalid data they enter if you receive this error. This means the transaction will be processed with valid data instead of storing invalid data which isn’t of use to anyone. However, if you do not wish to validate an optional field then it may be omitted in the request to Secure Trading (either by not including the XML tags or leaving the value blank).