This document describes how to perform a credit/debit card authorisation using the WebSmartConnect payments interface. This is part of the SmartPay system. It permits any merchant currently operating a SmartPay solution, to easily implement debit and credit card payment facilities on external third party web sites.
In order to make a card payment the calling application must send details of the payment request to the WebSmartConnect payment service. The service will validate the information supplied in the request, and if correct will create a payment link which it will return to the application, to which the customer can then be redirected.
Once the payment has been completed, the merchant can then query the payment service for the result.
It is only possible to perform payments via this interface. No facilities exist to support refunds. These should be performed by the Merchant using the SmartPay Administration module.
Interface Specification
This section, is intended to be read by software developers who wish to integrate WebSmartConnect into their e-commerce web site.
Making a Payment
In order to make a payment the calling application must redirect the user’s browser to the URL of the link provided by the WebsmartConnect payment service. (Note that there will be separate URL’s for live and test payments.)
The payment service is part of the Http Service interface. Fore more information on how the Http Services interface works, including code examples, see here.
To create this link, the application must call the PAY function on the payment service, with an XML or JSON payload describing the payment.
The required parameters are listed here.
This will return a link and a UID which you will need to query the result.
Example Payload
{
"PaymentReference":"60CB3C01F0E44B44",
"ReturnURL", "https://example.com/result.php?id=1234",
"Lines":[
{
"FundCode":"CT",
"Ref1":"CT1001",
"Amount":"1001"
},
{
"FundCode":"CT",
"Ref1":"CT1002",
"Amount":"1002"
}
]
}
Querying a Payment
When the payment returns to the specified Return URL, the payment service should be queried for the result, using the UID supplied earlier in the process.
(Note that we no longer pass the result back in the return parameters for security reasons.)
The GET function on the payment service will return the result of the payment.
In certain circumstances a payment request may be submitted to WebSmartConnect, and no response will be received. This is because the user may have aborted the payment process, or some system failure occurred that prevent the information being returned.
Contingency must therefore be made by the calling system to a) recognise, and b) reconcile the true result of any incomplete payments. This may be a manual process, or an automated one, and the required approach to resolving this issue should be carefully considered.
Postback Notifications
WebSmartConnect can be configured via our ConnectPay payment gateway to post back the results of a successful transaction to a pre-configured URL.
Postbacks will only occur for payments that have completed and have resulted in an authorisation. No postbacks will occur for requests that fail validation checks or are declined by the bank.
Postbacks will occur usually within around 60 seconds of the transaction completing. However if the result is not known to WebSmartConnect, it may take several hours before that result becomes known to the system and a postback occurs.
For more information, see here.