The Callback Mechanism

Total Page:16

File Type:pdf, Size:1020Kb

The Callback Mechanism

The callback mechanism

After payment has occurred you may need the transaction system to inform you of the transaction result as well as passing back information entered on the SH server. This is done using the callback mechanism, which is a server to server call performed in the background therefore your customer will not see the output of this script. It is important to note our callback uses the GET request method.

Creating a Callback Request

Within your secure payment form you need to pass through the following as form fields:-

The name of the script / file to call on your server:-

Also a field containing the data to be passed back to your script. Use named pairs, with all values separated by a pipe symbol, i.e.:-

So for example you may require the cardholdersname to be passed:-

You may notice the # in front of the cardholdersname field. This is required when the information is being entered on the payment page therefore needs to be dynamically replaced by the transaction system.

Our system will also append some transaction information to the end of the callback data. This information varies according to the result of the transaction:-

Transaction Result : Success transactionnumber Unique securehosting transaction reference. transactiontime Time the transaction was placed in “2004-12-16 00:33:12“ format. cv2avsresult If using real-time processing the CV2 / AVS Result is returned. “ALL MATCH” as an example.

Transaction Result : Failure transactionnumber -1 is always returned in the result of a failure. transactiontime Time the transaction was placed in “2004-12-16 00:33:12“ format. failurereason The reason that the transaction failed is given. “Card Type Not Supported” as an example.

The callback mechanism Page 1 of 2 Output from your Script

Please ensure the only output from your script is the word "success". As an example if you are using ASP, type ' response.write "success" ' at the end of your script or PHP users would type ‘echo (“success”);’. If you do not do this, we will not be able to track if the callback is working should you have any problems.

Processing the Callback:

All callbacks are added into a queue for processing and are called within two minutes of the transaction being placed. The option for an instant callback is given (this is set by the merchant in the Settings > Advanced Settings screen within the SH account).

When the callback is issued we capture the HTTP Status Code. Unless we receive a status code of 200 (a successful request) from your server when performing the callback it will be retried by our system every 2 minutes for the next 24 hours until a successful request is received.

If the callback hasn’t been successful after 24 hours then the callback will be deleted from the queue and no longer re-tried.

Extra Security

Our callback system always calls your server with a referrer of:- https://www.secure-server-hosting.com/secutran/ProcessCallbacks.php

This can be checked by your script to increase security.

The callback mechanism Page 2 of 2

Recommended publications