Gateway Integration Guide
Gateway Integration Guide
INTEGRATION GUIDE
GATEWAY
INTEGRATION GUIDE
Version: 2.00
V2.00
-1-
GATEWAY
INTEGRATION GUIDE
VERSION CONTROL
Ver. Date Author Update information
1.00 30/11/19 N Turner New guide replacing original separate Hosted and Direct Integration Guides.
1.01 24/08/20 N Turner Updated appendix A-12.1to include settlement outcome in test amounts table.
1.02 23/09/20 N Turner Updated appendix A-23.2.1 and appendix A-24.1.2 for 3DS v2.
1.03 22/10/20 N Turner Updated section 5.5.4 to reflect changes to 3DS options.
1.04 25/10/20 N Turner Removed CUROPT_SSL_VERIFYPEER from sample code.
1.05 25/11/20 N Turner Removed threeDSVersion and merchantCategoryCode fields from sample code.
1.06 07/12/20 N Turner Replaced Merchant ID and MID with Merchant Account ID.
Updated appendix A-15 to indicate specific MOTO or CA account may be required.
1.07 08/12/20 N Turner Added appendix detailing Visa Stored Credentials Framework (Credentials on File).
1.08 23/01/21 N Turner Updated section 26 to add Google Pay details.
1.09 28/01/21 N Turner Corrected ‘AmazonPay’ to ‘Amazon Pay’ and other minor spelling corrections.
1.10 03/02/21 N Turner Removed details for eReceipts integration.
1.11 21/02/21 N Turner Updated appendix A-12 to detail 3DS response simulation.
1.12 18/03/21 N Turner Added section 26.8 covering the features of Digital Wallet Payment Tokens.
1.13 23/03/21 N Turner Updated appendix A-12 to add SCA soft-decline test amounts.
1.14 13/06/21 N Turner Revised appendix A-11 adding more details and support for Discover and Diners Club.
Updated appendix A-12 to add further testing details for Referral response testing.
Corrected mistakes in the available threeDSOptions in section 5.5.4.
Amended section 1.7.8 to remove XML format and explain how to pass boolean values.
Added rtAgreementType, rtSequenceCount and rtSequenceNumber fields to section 2.1.
Added rtSequenceCount and rtSequenceNumber fields to appendix A-15.3.
Corrected the descriptions for response code’s 65794 and 65796 in appendix A-1.
Removed the text ‘(reserved for future use)’ from response code descriptions in appendix A-1.
Reformatted CSS selectors and attribute names and added details regarding custom fonts to the
Hosted Fields Styling appendix A-21.3.10.
Added formAmountEditable field to appendix A-20.
Updated threeDSEnrolled and threeDSAuthenticated values in section 5 and appendix A-3.
1.15 16/06/21 N Turner Added further explanations and updated the response codes in appendix A-1.
1.16 22/07/21 S Fowle Added links to fields mentioned in Response Codes in appendix A-1.
Updated Response Code descriptions in appendix A-1.
Anonymised content, removing any specific URLs, Merchant Account IDs, etc.
1.17 14/08/21 N Turner Various formatting changes and clarifications.
Added more details to sections 1.7.1 and 1.7.8.
Added details on how to switch between latest and legacy 3-D Secure responses to section 5.3.
Updated details about mandatory 3-D Secure information to sections 5.3, 5.4 and 5.5.4.
Updated details regarding complex fields threeDSRequest, threeDSResponse, checkoutRequest
and checkoutResponse to sections 5.4, 21.4 and 22.4.
Updated details on 3-D Secure requests in sections 5.5 and 5.6.
Added details on 3-D Secure fallback to version 1 and PSD2 SCA in section 5.7.
Added PSD2 SCA Compliance and exemptions in appendix A-18.
Added clarification that Hosted Fields can be used with standard fields in appendix A-21.3.1.
Updated and moved Hosted Payment Form Options to appendix A-20.
Moved details on Duplicate Transaction checking to appendix A-9.
Revised details on Delaying Capture and Settlement in appendix A-10.
Moved details on Recurring transaction and Credentials on File to section 12.
Removed rtSequenceCount and rtSequenceNumber fields from section 2.1.
Added details on Acquirer specific options and response details in section 18.
Added card token details to section 19.
Updated cloned fields in appendix A-17.1.
Added cardFlags field and ‘Scheme Code’ table column to appendix A-11.
2.00 18/10/21 N Turner Added example threeDSOptions to code samples in appendix A-23.2.1 and A-24.1.2.
Added addition information on the 3-D Secure fields to appendix A-3.
Added matrix for correct Credentials on File (COF) flagging in new appendix A-18.
Added more details on SCA declines and new appendix A-19.2.
Added note that Diners Club do not support AVS to appendix A-12.2.9
V2.00
-2-
GATEWAY
INTEGRATION GUIDE
CONTENTS
1 Gateway Integration ........................................................................................................................................ 4
2 New Transactions .......................................................................................................................................... 22
3 Management Requests .................................................................................................................................. 26
4 AVS/CV2 Checking ........................................................................................................................................ 28
5 3-D Secure Authentication ............................................................................................................................ 32
6 Risk Checking ................................................................................................................................................ 57
7 Payment Facilitators ...................................................................................................................................... 65
8 UK MCC 6012 Merchants .............................................................................................................................. 67
9 Billing Descriptor ........................................................................................................................................... 69
10 Surcharges ..................................................................................................................................................... 71
11 Receipts and Notifications............................................................................................................................ 75
12 Credentials on File ......................................................................................................................................... 79
13 Recurring Transaction Agreements ............................................................................................................ 85
14 Dynamic Currency Conversion .................................................................................................................... 89
15 Purchase Data ................................................................................................................................................ 97
16 Custom Data ................................................................................................................................................. 100
17 Advanced Data ............................................................................................................................................. 101
18 Acquirer Data ............................................................................................................................................... 109
19 Gateway Wallet ............................................................................................................................................ 111
20 Masterpass Wallet ....................................................................................................................................... 118
21 PayPal Transactions .................................................................................................................................... 129
22 Amazon Pay Transaction ............................................................................................................................ 154
23 PPRO Transactions ..................................................................................................................................... 166
24 Pay by Bank app (PBBA) Transactions ..................................................................................................... 179
25 SecurePlus Transactions ............................................................................................................................ 187
26 Digital Wallet Transactions ......................................................................................................................... 191
A-1 Response Codes .......................................................................................................................................... 197
A-2 AVS / CV2 Check Response Codes ........................................................................................................... 226
A-3 3-D Secure Authentication Data ................................................................................................................. 228
A-4 3-D Secure Enrolment/Authentication Only .............................................................................................. 231
A-5 3-D Secure Legacy API ................................................................................................................................ 232
A-6 Request Checking Only .............................................................................................................................. 238
A-7 Merchant Account Mapping........................................................................................................................ 239
A-8 Velocity Control System (VCS) .................................................................................................................. 240
A-9 Duplicate Transaction Checking ................................................................................................................ 241
A-10 Capture Delay ............................................................................................................................................... 242
A-11 Card Identification ....................................................................................................................................... 243
A-12 Integration Testing ...................................................................................................................................... 246
A-13 Sample Signature Calculation .................................................................................................................... 254
A-14 Transaction Life cycle ................................................................................................................................. 256
A-15 Transaction types ........................................................................................................................................ 260
A-16 Payment Tokenisation ................................................................................................................................. 261
A-17 Transaction Cloning .................................................................................................................................... 264
A-18 Credentials on File Matrix ........................................................................................................................... 270
A-19 PSD2 SCA Compliance ............................................................................................................................... 272
A-20 Hosted Payment Page Options .................................................................................................................. 277
A-21 Integration Libraries .................................................................................................................................... 279
A-22 Example HTTP Requests ............................................................................................................................ 313
A-23 Example Integration Code .......................................................................................................................... 321
A-24 Example Library Code ................................................................................................................................. 332
A-25 Frequently Asked Questions ...................................................................................................................... 348
INDEX ....................................................................................................................................................................... 349
V2.00
-3-
GATEWAY
INTEGRATION GUIDE
1 Gateway Integration
1.1 About This Guide
This guide provides the information required to integrate with our Payment Gateway and gives a
very basic example of code for doing so. It is expected that you have some experience in server-
side scripting with languages such as PHP or ASP; or that an off-the-shelf software package is
being used that has inbuilt or plug-in support for our Gateway.
Disclaimer
This guide provides the integration documentation necessary for enabling Merchants to process
payments via our Gateway. Whilst every effort has been made to ensure these guides are
accurate and complete, we expect Merchants undertaking any integration to test all their technical
work fully and satisfy their own standards. The authors of this guide are not responsible or liable
for any Merchant or Third-Party integration
V2.00
-4-
GATEWAY
INTEGRATION GUIDE
1.2 Terminology
The following terms are used throughout this guide:
Gateway
The Payment Gateway.
Merchant
The Merchant using the Gateway’s services.
Our
The Payment Gateway Provider.
You/your
The Merchant or its representative performing the integration.
Acquirer
The bank or financial institution used by the Merchant.
Customer
A Customer of the Merchant making a payment.
Card
A payment credit, debit, prepayment or gift card issued by the Card Schemes.
Card Scheme
The operator of a payment Card network, such as Visa, Mastercard, et al.
Cardholder
The person who owns the payment Card, usually the Customer.
Issuer
The bank or financial institution that issued the payment Card to the Cardholder.
Merchant Account
An account on the Gateway mapped to an Acquirer-provided account.
Checkout
Third-party checkout solution such as PayPal, Amazon Pay other alternative payment methods.
Wallet
Third-party wallet solution such as Masterpass.
V2.00
-5-
GATEWAY
INTEGRATION GUIDE
The Hosted Integration method works by redirecting the Customer to our Gateway’s Hosted
Payment Page, which will collect the Customer’s payment details and process the payment before
redirecting the Customer back to a page on your website, letting you know the payment outcome.
This allows you the quickest path to integrating with the Gateway.
The standard Hosted Payment Page is designed to be shown in a lightbox over your website and
styled with logos and colours to match. Alternatively, you can arrange for fully customised Hosted
Payment Pages to be produced that can match your website’s style and layout. These fully
customised pages are usually provided using a browser redirect, displaying full-page in the
browser, or can be displayed embedded in an iframe on your website.
For greater control over the customisation of the payment page, our Gateway offers the use of
Hosted Payment Fields, where only the individual input fields collecting the sensitive Cardholder
data are hosted by the Gateway while the remainder of the payment form is provided by your
website. These Hosted Payment Fields fit seamlessly into your payment page and can be styled to
match your payment fields. When your payment form is submitted to your server, the Gateway will
submit a payment token representing the sensitive card data it collected and your webserver can
then use the Direct Integration to process the payment without ever being in contact with the
collected Cardholder data. For more information, please refer to our Hosted Payment Fields SDK
Guide.
V2.00
-6-
GATEWAY
INTEGRATION GUIDE
In addition to basic sales processing, the Direct Integration can be used to perform other actions
such as refunds and cancellations, which can provide a more advanced integration with our
Gateway.
In addition to basic sales processing, the Batch Integration can be used to perform other actions,
such as refunds and cancellations, which can provide a more advanced integration with our
Gateway.
Unlike the Hosted and Direct Integrations, the Batch Integration does not process transactions
sent to it immediately. Instead, the Gateway queues these transactions to be processed and
returns a batch reference number which can be used to download a file that contains the current
status of the transactions.
Batch Processing does not support transactions that require Customer interaction such as 3-D
Secure transactions, or alternative payment methods with interactive Wallet or Checkout pages.
V2.00
-7-
GATEWAY
INTEGRATION GUIDE
These libraries include simple server-side classes in many popular programming languages,
through to client-side scripts to help with the integration of the Hosted Payment Page or Hosted
Payment Fields.
For more information about these libraries, please refer to appendix A-20.
V2.00
-8-
GATEWAY
INTEGRATION GUIDE
If you use Hosted Payment Pages with the Hosted Integration or Hosted Payment Fields with the
Direct or Batch Integrations, then your webserver does not need an SSL certificate and you
require the lowest level of PCI DSS compliance.
If your website collects and/or stores sensitive Cardholder data, such as the card number (PAN) or
card security code (CVV/CV2), then your webserver must have an SSL certificate and serve all
payment forms using HTTPS. You will also need a higher level of PCI DSS compliance and to
complete a PCI validation form annually.
V2.00
-9-
GATEWAY
INTEGRATION GUIDE
1.6 Prerequisites
You will need the following information to integrate with the Gateway which will be provided during
onboarding:
Hosted Integration URL Your unique URL to use the Hosted Integration.
Direct Integration URL Your unique URL to use the Direct Integration.
Batch Integration URL Your unique URL to use the Batch Integration.
You will be provided with unique production and test Merchant Account IDs during the onboarding
process. You will also be provided with the integration URLs.
You must use the URLs provided and no others as they may be customised to your account.
Any code samples in this guide use dummy Merchant Account IDs in the form 100001 and dummy
integration URLs of the form ‘https://gateway.example.com/<integration>’. These dummy values
must be replaced in full by the values you have been provided with.
For testing purposes, you can use test amounts and test cards provided in appendix A-12 to run a
test transaction.
V2.00
- 10 -
GATEWAY
INTEGRATION GUIDE
Complex fields consisting of single or multidimensional records or arrays must be formatted as per
the PHP http_build_query() method using square brackets to represent multiple dimensions. The
sub-field names must be numeric or alphanumeric only, alphanumeric fields must not start with a
numeric. Any square brackets around the nested field names should be URL encoded, [ as %5B
and ] as %5D.
The following example request contains a complex items field consisting of an array of records
representing the following table of purchased items.
Newspaper 1 110
Carrier bag 1 10
merchantID=100001&action=SALE&type=1&amount=1001¤cyCode=826&countr
yCode=826&transactionUnique=55f6db1c81d95&orderRef=Test+purchase&custome
rPostCode=NN17+8YG&responseCode=0&responseMessage=AUTHCODE%3A350333&stat
e=captured&xref=15091702MG47WN32MM88LPK&cardNumber=4929+4212+3460+0821&c
ardExpiryDate=1215&items%5B0%5D%5Bdescription%5D=Newspaper&items%5B0%5D%
5Bquantity%5D=1&items%5B0%5D%5Bamount%5D=110&items%5B1%5D%5Bdescription%
5D=Chocolate+bar&items%5B1%5D%5Bquantity%5D=3&items%5B1%5D%5Bamount%5D=2
49&items%5B2%5D%5Bdescription%5D=Carrier+bag&items%5B2%5D%5Bquantity%5D=
1&items%5B2%5D%5Bamount%5D=1
Please note that the field and sub-field names must be alphanumeric only and are cAsE
sEnSiTiVe. Root integration fields must be numeric only and alphanumeric fields must not
start with a numeric.
The response will use the same URL encoding and return the request fields in addition to any
dedicated response field. If the request contains a field that is also intended as a response field,
then any incoming request value will be overwritten by the correct response value.
The Gateway may add new response fields at any time and so your integration must be
able to handle and ignore such fields until the time you upgrade your integration to use the
new response data.
V2.00
- 11 -
GATEWAY
INTEGRATION GUIDE
When the Hosted Payment Page has been completed and the payment processed, the
Customer’s browser will be automatically redirected to the URL provided via the redirectURL
field. The response will be returned to this page in application/x-www-form-urlencoded
format, using a HTTP POST request.
All request fields will be returned in the response and a Merchant may add custom request fields
as detailed in section 16. If the request contains a field that is also intended as a response field,
then any incoming request value will be overwritten by the correct response value.
The Gateway may add new request and response fields at any time and so your integration
must take care not to send request fields that may conflict with future Gateway fields and
be able to ignore response fields which it doesn’t yet understand.
An example of a Hosted Integration request is provided in appendix A-22.1 and sample code is
provided in appendix A-23.1.
If a redirectURL field is provided, then the response will be a HTML page designed to redirect
a browser to the URL provided, using a HTTP POST request containing the response. This allows
you to collect the Cardholder’s payment details on your own server, using a HTML form which
POSTs to the Direct Integration, which then effectively POSTs the results back to this URL your
webserver, where you can display the transaction outcome.
All request fields will be returned in the response and a Merchant may add custom request fields
as detailed in section 16. If the request contains a field that is also intended as a response field,
then any incoming request value will be overwritten by the correct response value.
The Gateway may add new request and response fields at any time and so your integration
must take care not to send request fields that may conflict with future Gateway fields and
be able to ignore response fields which it doesn’t yet understand.
An example of a Direct Integration request is provided in appendix A-22.1 and sample code is
provided in appendix A-23.1.
V2.00
- 12 -
GATEWAY
INTEGRATION GUIDE
You can optionally specify a Content-Id HTTP header to identify each part message uniquely; if
not provided, the Gateway will assign a unique id to each part. The Content-Id HTTP header is
returned in the response. The Gateway will not validate the uniqueness of any id provided. After
the mandatory Content-type and the optional Content-Id header, two carriage return/line
feed pairs must follow (ie \r\n\r\n). Any deviation from this structure might lead to the part being
rejected or incorrectly interpreted. The part request payload, formatted as a regular HTTP URL
encoded request, must follow the two line breaks directly.
To reduce the size of large batch requests, the Gateway supports compression using a Content-
Encoding HTTP header with either a ‘gzip’ or ‘x-gzip’ value. This header can be provided in the
main request or in the part request or both.
An Authorization HTTP header can be used in the request to provide the username and
password of a Gateway Merchant Management System user account. If correct, the batch details
will be recorded as having been submitted by that user; if invalid, then the request will fail and
respond with a 401 (Unauthorised) HTTP status code.
The Gateway will respond in the same manner as the request with a multipart/mixed content
type; each part is the response to one of the requests in the batched request. In addition, the
response will contain a standard Location HTTP header, providing a URL from which further
batch update responses can be downloaded; and a standard Content-Disposition header,
allowing a browser to download the response to a file. If the request contained an
Authorization HTTP header, then the response will contain an X-P3-Token HTTP header
containing an authentication token that can be sent in future requests instead of the username and
password. The authentication token has a limited life span, but each future request will return a
new token and thus effectively rejuvenate the token’s life.
Like the parts in the request, each response part contains a HTTP response, including headers
and body. Each response part is preceded by a Content-Type HTTP header and Content-ID
HTTP header. In addition, an X-Transaction-ID HTTP header is added containing the
requests transaction id together with an X-Transaction-Response HTTP header containing a
textual description of the transaction processing status.
V2.00
- 13 -
GATEWAY
INTEGRATION GUIDE
The Gateway will not process the transactions immediately but will queue them up to process over
time. The transactions may not be processed in the order provided, so should not have
interdependencies. Transactions will only appear in the Merchant Management System when they
have been processed. The status of queued transaction is only available by querying the status of
the batch.
The current status of a batch can be queried at any time by issuing a HTTP GET request to the
URL provided in the initial responses Location HTTP header.
An Authorization HTTP header must be provided in the status request, containing either the
username and password of a Gateway Merchant Management System user account or an
authentication token returned in the batch submission response’s X-P3-Token HTTP header. If a
valid username and password or a valid token is provided, then the response will be an updated
version of the initial submission response providing the current status of each transaction. The
response will only contain transactions that the authenticated user has permission to view.
All request fields will be returned in the response and a Merchant may add custom request fields
as detailed in section 16. If the request contains a field that is also intended as a response field,
then any incoming request value will be overwritten by the correct response value.
The Gateway may add new request and response fields at any time and so your integration
must take care not to send request fields that may conflict with future Gateway fields and
be able to ignore response fields which it doesn’t yet understand.
An example of a Batch Integration request is provided in appendix A-22.3 and sample code is
provided in appendix A-23.3.
V2.00
- 14 -
GATEWAY
INTEGRATION GUIDE
If the Gateway is unavailable during a scheduled maintenance period, you will receive a HTTP
status code of 503 ‘Service Temporarily Unavailable’. In this situation, you should retry the
transaction after the scheduled maintenance period has expired. You will be notified of the times
and durations of any such scheduled maintenance periods in advance, by email, and given a time
when transactions can be reattempted.
If you are experiencing these errors, then we recommend you consider the following steps as
appropriate for the integration method being used:
• Ensure the request is being sent to HTTPS and not HTTP. HTTP is not supported and is
not redirected.
• Send transactions sequentially rather than concurrently.
• Configure your integration code with try/catch loops around individual transactions to
determine whether they were successful or not and retry if required, based on the return
code or HTTP status returned.
• Configure the integration so that if one transaction fails, the entire batch does not stop at
that point – ie log the failure to be checked and then skip to the next transaction rather than
stopping entirely.
V2.00
- 15 -
GATEWAY
INTEGRATION GUIDE
When provided, the Gateway will respond with a HTML page designed to redirect the Customer’s
browser to the URL provided, using a HTTP POST request containing the URL encoded response.
For the Hosted Integration, this will redirect the Customer from the Hosted Payment Page back to
this URL on your website.
For the Direct Integration, this allows you to collect the Cardholder’s payment details on your own
server using a HTML form that POSTs to the Direct Integration. which then effectively POSTs the
results back to this URL on your webserver, where you can display the transaction outcome. This
usage is not recommended as it makes it harder to sign the message.
The URL is mandatory for the Hosted Integration and optional for the Direct Integration. It is not
supported by the Batch Integration.
The redirectURL must be a fully qualified URL, containing at least the scheme and host
components.
The URL is optional for both the Hosted Integration and the Direct Integration. It is not supported
by the Batch Integration.
The callbackURL must be a fully qualified URL, containing at least the scheme and host
components.
V2.00
- 16 -
GATEWAY
INTEGRATION GUIDE
Unless otherwise stated, numerical values are whole integer values with no decimal points.
Textual values should use the UTF-8 character set and will be automatically truncated if too long,
unless stated otherwise in the field’s description. Textual values may be transliterated1 when
sending to third parties such as Acquirers but the original value is stored by Gateway and
displayed in the Merchant Management System.
Field values should use the following formats unless otherwise stated in the field’s description:
Monetary Amounts Either major currency units by providing a value that includes a single decimal point
such as ’10.99’; or in minor currency units by providing a value that contains no
decimal points such as ‘1099’.
Records Records can be provided using the [Y] notation, where Y is the record’s sub-field
name. Records can be nested to any depth, that is a sub-field’s value can be
another record. Arrays can be provided by using numeric sub-fields starting with the
value 0 and incrementing by 1. For example: to send a value for the sub-field Z, of
the sub-field Y in the integration field X, use the field name X[Y][Z]; however, to send
a value for the sub-field Z in the fourth record for integration field X, then use the
field name X[4][Z] etc. Boolean values must be sent as the words ‘true’ or ‘false’.
Serialised Records Certain fields allow records to be sent as JSON or URL serialised strings. If the first
character of the serialised string is ‘{‘, then the string is assumed to be in JSON
format with any boolean values sent as their JSON equivalents, all other strings will
be assumed to be application/x-www-form-urlencoded format with any boolean
values sent as the words ‘true’ or ‘false’.
Note: Record format is useful when posting sub-fields directly from individual field in a HTML
FORM. However, unlike the main integration fields, a record’s sub-fields are not sorted when
constructing the signature and are processed in the order received. Serialised record format can
overcome any problems caused by the sub-fields of a record being received in a different order to
that used when generating the signature. Not all fields using the record format also support the
serialised record format especially the threeDSRequest, threeDSResponse,
checkoutRequest, checkoutResponse and the purchase items field.
Boolean values cannot be represented when using the record format or the application/x-www-
form-urlencoded serialised record format and the words ‘true’ and ‘false’ must be used. The JSON
serialised record format does not have this restriction and a JSON boolean can be used.
1Transliteration involves the changing of character case, stripping of accents from characters and removal of unsupported
characters so that the values meet the requirements of the third-party.
V2.00
- 17 -
GATEWAY
INTEGRATION GUIDE
1.8 Authentication
All requests must specify which Merchant Account they are for, using the merchantID request
field. In addition to this, the following security measures can be used:
Warning: Use of a password is discouraged in any integration where the transaction is posted from a form in the
client browser as the password may appear in plain text in code.
The Gateway will also return hash of the response message in the returned signature field,
allowing you to create your own hash of the response (minus the signature field) and verify that
the hashes match.
Message signing maybe mandatory on some Merchant Accounts and if so, the Merchant
Management System will only allow the secret phrase to be changed but not removed
entirely.
If message signing is enabled, then the data POSTed to any callback URL will also be signed.
V2.00
- 18 -
GATEWAY
INTEGRATION GUIDE
1.9.1 SALE
This will create a new transaction and attempt to seek authorisation for a sale from the Acquirer. A
successful authorisation will reserve the funds on the Cardholder’s account until the transaction is
settled.
The captureDelay field can be used to state whether the transaction should be authorised only
and settled at a later date. For more details on delayed capture, refer to appendix A-9.
1.9.2 VERIFY
This will create a new transaction and attempt to verify that the card account exists with the
Acquirer. The transaction will result in no transfer of funds and no hold on any funds on the
Cardholder’s account. It cannot be captured and will not be settled. The transaction amount must
always be zero.
This transaction type is the preferred method for validating that the card account exists and is in
good standing; however, it cannot be used to validate that it has sufficient funds.
1.9.3 PREAUTH
This will create a new transaction and attempt to seek authorisation for a sale from the Acquirer. If
authorisation is approved, then it is immediately voided (where possible) so that no funds are
reserved on the Cardholder’s account. The transaction will result in no transfer of funds. It cannot
be captured and will not be settled.
This transaction type can be used to check whether funds are available and that the account is
valid. However, due to the problem highlighted below, it is recommended that Merchants use the
VERIFY action when supported by their Acquirer.
Warning: If the transaction is to be completed then a new authorisation must be sought using the SALE action. If
the PREAUTH authorisation could not be successfully voided, then this will result in the funds’ being authorised
twice effectively putting two holds on the amount on the Cardholder’s account and thus requiring twice the amount
to be available in the Cardholder’s account. It is therefore recommended only to PREAUTH small amounts, such
as £1.00 to check mainly account validity.
V2.00
- 19 -
GATEWAY
INTEGRATION GUIDE
1.9.4 REFUND_SALE
This will create a new transaction and attempt to seek authorisation for a refund of a previous
SALE from the Acquirer. The transaction will then be captured and settled if and when appropriate.
It can only be performed on transactions that have been successfully settled. Up until that point, a
CANCEL or partial CAPTURE can be used, to refund or partially refund the original SALE
transaction. The previous SALE transaction should be specified using the xref field.
Partial refunds are allowed by specifying the amount to refund. Any amount must not be greater
than the original received amount minus any already refunded amount. Multiple partial refunds
may be made while there is still a portion of the originally received amount un-refunded.
The captureDelay field can be used to state whether the transaction should be authorised only
and settled at a later date. For more details on delayed capture refer to appendix A-9.
1.9.5 REFUND
This will create a new transaction and attempt to seek authorisation for a refund from the Acquirer.
The transaction will then be captured and settled if and when appropriate. This is an independent
refund and need not be related to any previous SALE. The amount is therefore not limited by any
original received amount.
The captureDelay field can be used to state whether the transaction should be authorised only
and settled at a later date. For more details on delayed capture refer to appendix A-9.
1.9.6 CAPTURE
This will capture an existing transaction, identified using the xref request field, making it available
for settlement at the next available opportunity. It can only be performed on transactions that have
been authorised but not yet captured. An amount to capture may be specified but must not
exceed the original amount authorised.
The original transaction must have been submitted with a captureDelay value that prevented
immediate capture and settlement leaving the transaction in an authorised but un-captured state.
For more details on delayed capture refer to appendix A-9.
V2.00
- 20 -
GATEWAY
INTEGRATION GUIDE
1.9.7 CANCEL
This will cancel an existing transaction, identified using the xref request field, preventing it from
being settled. It can only be performed on transactions, which have been authorised but not yet
settled, and it is not reversible. Depending on the Acquirer it may not reverse the authorisation and
release any reserved funds on the Cardholder’s account. In such cases authorisation will be left to
expire as normal, releasing the reserved funds. This may take up to 30 days from the date of
authorisation.
1.9.8 QUERY
This will query an existing transaction, identified using the xref request field, returning the original
response. This is a simple transaction lookup action.
V2.00
- 21 -
GATEWAY
INTEGRATION GUIDE
2 New Transactions
You can perform a new transaction, such as a sale, by sending a request with the required action
and transaction type together with details about the order and payment method.
V2.00
- 22 -
GATEWAY
INTEGRATION GUIDE
orderRef No3 Free format text field to store order details, reference
numbers, etc. for the Merchant’s records.
redirectURL No6 URL to which the hosted form will redirect the
Customer’s browser after the transaction has been
completed. The URL must be fully qualified and
include at least the scheme and host components.
Refer to section 1.7.6 for details.
1 A password is not recommended if using the Hosted Integration, use a signature instead.
2 A signature maybe mandatory on some Merchant Accounts and requests.
3 Optional if an xref is provided as the value will be taken from the cross-referenced transaction.
4 Optional if using the Hosted Integration, any value provided will be used to initialise any HPP input field.
5 Mandatory for a REFUND_SALE request to specify the original SALE transaction.
6 Not supported by the Batch Integration.
7 Not supported by the Hosted Integration, which will automatically use the Customer’s IP address.
8 Mandatory for recurring transactions or other transactions using stored credentials.
V2.00
- 23 -
GATEWAY
INTEGRATION GUIDE
xref Always You may store the cross reference for repeat
transactions.
Refer to appendix A-16 for details.
amountRefunded If refund Total amount of original SALE that has so far been
refunded. Returned when action is REFUND_SALE.
V2.00
- 24 -
GATEWAY
INTEGRATION GUIDE
Other response fields may be returned as documented elsewhere in this guide. Undocumented
fields may be returned at the Gateways discretion but should not be relied upon.
The acquirerResponseXXXX fields are dependent on the Acquirer in use and are supplied for
additional information only.
V2.00
- 25 -
GATEWAY
INTEGRATION GUIDE
3 Management Requests
You can perform a management action on an existing transaction, such as a capture or
cancellation, by sending a request with the required action together with the cross reference for
the transaction to act on.
Management requests are supported by the Direct and Batch Integrations, they are not
supported by the Hosted Integration.
1 A password is not recommended if using the Hosted Integration, use a signature instead.
2 A signature maybe mandatory on some Merchant Accounts and requests.
3 An amount is only required for partial refunds or partial captures.
V2.00
- 26 -
GATEWAY
INTEGRATION GUIDE
Other response fields may be returned as documented elsewhere in this guide. Undocumented
fields may be returned at the Gateways discretion but should not be relied upon.
V2.00
- 27 -
GATEWAY
INTEGRATION GUIDE
4 AVS/CV2 Checking
4.1 Background
AVS and CV2 fraud checking is available on all card transactions processed by the Gateway
where supported by the Acquirer.
These fraud prevention checks are performed by the Acquirer while authorising the transaction.
You can choose how to act on the outcome of the check (or even to ignore them altogether).
For most cards, the CVV is a 3-digit number to the right of the signature strip. For American
Express cards, this is a 4-digit number printed, not embossed, on the front right of the card.
The AVS/CV2 checking preferences can be configured per Merchant Account within the Merchant
Management System (MMS). These preferences can be overridden per transaction by sending
one of the preference fields documented in section 4.3 that hold a comma separated list of the
check responses that should be allowed in order to continue to completion. Responses not in the
list will result in the transaction being declined with a responseCode of 5 (AVS/CV2 DECLINED).
AVS/CV2 fraud checking is not available with all Acquirers and must be enabled on your Merchant
Account before it can be used. Please contact support to find out whether your Acquirer supports it
and if it can be enabled on your Merchant Account.
V2.00
- 28 -
GATEWAY
INTEGRATION GUIDE
• The results are available immediately and returned as part of the transaction.
• The checks can be managed independently, allowing you the utmost control over how the
results are used.
• There are no extra costs for using AVS/CV2 checking with your transactions.
4.2.2 Limitations
• The AVS checks are mainly supported by Visa, MasterCard and American Express in the
USA, Canada and United Kingdom. Cardholders with a bank that does not support the
checks might receive declines due to the lack of data.
• Because AVS only verifies the numeric portion of the address and postcode, certain
anomalies such as apartment numbers and house names can cause false declines.
• The checks are meant for consumer cards. Company cards are not fully supported due to
the Acquirers’ not having access to this information.
V2.00
- 29 -
GATEWAY
INTEGRATION GUIDE
cardCVV Yes3 For CVV checking, this must be the Card Verification
Value printed on the card.
V2.00
- 30 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 31 -
GATEWAY
INTEGRATION GUIDE
It allows the Cardholder to assign a password to their card that is then verified whenever a
transaction is processed through a site that supports the use of the scheme. The addition of
password protection allows extra security on transactions that are processed online.
3-D Secure stands for Three Domain Secure. There are 3 parties that are involved in the 3-D
Secure process:
• The company from which the purchase is being made.
• The Acquiring Bank (the bank of the company)
• VISA and Mastercard (the card issuers themselves)
The gateway supports 3-D Secure as implemented by Visa, Mastercard and American Express
and marketed under the brand names of Verified by VISA (VBV), Mastercard Secure Code (MSC)
and American Express (SafeKey). Implementations by JCB (J/Secure) and DCI (ProtectBuy) are
not currently supported.
3-D Secure is also the only fraud prevention scheme available that offers you liability cover for
transactions that are verified by the checks. This provides additional protection for transactions
using the scheme as distinct from those that do not.
The 3-D Secure preferences can be configured per Merchant Account within the Merchant
Management System (MMS). These preferences can be overridden per transaction by sending
one of the preference fields documented in section 5.5.1, which hold a comma separated list of the
check responses that should be allowed to continue to completion. Responses not in the list will
result in the transaction being declined with a responseCode of 65803
(3DS_NOT_AUTHENTICATED).
The Gateway supports both 3-D Secure version 1 and version 2 and will use the highest version
available. Version 2 is also commonly known as EMV 3-D Secure.
3-D Secure is not available with all Acquirers and must be enabled on your Merchant Account before
it can be used. Please contact support to find out whether your Acquirer supports it and if it can be
enabled on your Merchant Account.
3-D Secure is supported by the Hosted and Direct Integrations. It is not supported by the
Batch Integration.
V2.00
- 32 -
GATEWAY
INTEGRATION GUIDE
• The checks can be managed independently allowing you the utmost control over how the
results are used.
• The checks can be configured to decline the transaction automatically, where required.
• There are no extra Gateway costs for using 3-D Secure. Your Acquirer may charge to add
this onto your business account; however, you may also find that your transaction charges
are lower as a result of using 3-D Secure.
5.2.2 Limitations
• Authenticated 3-D Secure transactions do not guarantee a liability shift and chargebacks
can still occur. This is decided at the discretion of your Acquirer, with whom you should
check its policy.
• The gateway does not support 3-D Secure for JCB or Diner’s club cards.
• 3-D Secure transactions require a browser in order to display the Customer authentication
dialog.
V2.00
- 33 -
GATEWAY
INTEGRATION GUIDE
The 3-D Secure authentication form is designed and controlled by the Customer’s Issuing bank
and will display the Merchant Account name and any website address added when the account
was onboarded. You can change the displayed name and website address by sending the
merchantName and/or merchantWebsite request fields. Any merchantWebsite must be a
fully qualified URL containing at least the scheme and host components.
For 3-D Secure version 2 you may also pass additional information about the transaction and
Cardholder, using the threeDSOptions field as documented in section 5.5.4. This extra
information can help the Issuer decide on whether a challenge is required. This version also
requires your Merchant Account to be configured with your Merchant Category Code (MCC). This
value can be configured in the Merchant Management System (MMS) or provided using the
merchantCategoryCode or threeDSOptions request fields.
If you would like an example of a 3-D Secure Hosted Integration, please refer to our sample code
appendix A-23.1.
For backward compatibility, the Hosted Integration will currently return the legacy 3-D Secure API
response fields as documented in Appendix A-5 if it performs 3-D Secure version 1.
If 3-D Secure version 2 is used or one of the latest API 3-D Secure request, response or any of the device
fields are used in the request, then it will return the latest API response fields as documented in section
5.6.2. (Note: response and device fields will be ignored in any request but will cause it to switch response
format.)
To switch to always using the latest API response fields we highly recommend you pass in one of the
following fields: threeDSPolicy, threeDSOptions or initiator.
V2.00
- 34 -
GATEWAY
INTEGRATION GUIDE
The 3-D Secure authentication form is designed and controlled by the Customer’s Issuing bank
and will display the Merchant Account name and any website address added when the account
was onboarded. You can change the displayed name and website address by sending the
merchantName and/or merchantWebsite request fields. Any merchantWebsite must be a
fully qualified URL containing at least the scheme and host components.
For 3-D Secure version 2 you must also provide details about the Cardholder’s device, using the
fields documented in section 17.7 or using the associated options in the threeDSOptions field
as documented in section 5.5.3. You may also use the threeDSOptions field to pass additional
information about the transaction and Cardholder, which can help the Issuer decide on whether a
challenge is required. This version also requires your Merchant Account to be configured with your
Merchant Category Code (MCC). This value can be configured in the Merchant Management
System (MMS) or provided using the merchantCategoryCode or threeDSOptions request
fields.
The direct integration uses two complex fields to pass data between the 3-D Secure Access
Control Server (ACS) and the Gateway. The threeDSRequest field will be provided by the
Gateway and is a record whose name/value properties must be sent via a HTTP POST request to
the ACS usually via means of a hidden HTML form you have rendered in Cardholder’s browser
and then submitted using JavaScript. The corresponding threeDSResponse field should be
returned to the Gateway and must be a record containing name/value properties taken from the
HTTP POST received from the ACS when it redirects the Cardholder’s browser back to your
threeDSRedirectURL on completion of any challenge.
Note that the contents of the threeDSRequest and threeDSResponse fields are formatted
using the record format detailed in section 1.7.8 and their contents should be regarded as opaque
and all name/value pairs received from the Gateway must be sent to the ACS, and vice versa. The
Gateway does not currently support these fields to be provided in the serialised record format.
If you would like an example of a 3-D Secure Direct Integration, please refer to our sample code
appendix A-23.2.
V2.00
- 35 -
GATEWAY
INTEGRATION GUIDE
If the Gateway determines that the transaction is not eligible for 3-D Secure, then it will continue to
process it as a normal transaction without 3-D Secure, unless the threeDSRequired request
field indicates that the transaction should be aborted instead.
To support 3-D Secure, you must pass the threeDSRedirectURL field in the initial request. This
field must contain the complete URL to a web page on your server that the 3-D Secure Access
Control Server (ACS) will HTTP POST the authentication results back to, when the authentication
has been completed.
If the Gateway determines that the transaction is eligible, it will respond with a responseCode of
65802 (3DS AUTHENTICATION REQUIRED) and included in the response will be a
threeDSReqest containing data that should be sent to the ACS at the threeDSURL using a
HTTP POST request. The response will also contain a threeDSRef that can be used to continue
the transaction when the authentication has been completed.
For 3-D Secure version 1, a single challenge is performed. However, for version 2, there may be
zero, one or two challenges.
With 3-D Secure version 2, an initial device fingerprinting method might have to be invoked on the
ACS, the results of which are used to determine whether the Cardholder must complete a
challenge or whether a frictionless flow can be achieved where the transaction can continue
unchallenged.
V2.00
- 36 -
GATEWAY
INTEGRATION GUIDE
The IFRAME should be of sufficient size to display the ACS challenge form. For 3-D Secure
version 1, this is a fixed size of 390x400 pixels. However, version 2 allows different sizes to be
specified giving the Merchant more flexibility in the design of its payment form. The required size
can be set using the ‘challengeWindowSize’ option, passed in the threeDSOptions field in the
initial request.
This method should take no longer than 10 seconds and therefore if the ACS has not POSTed the
results back within 10 seconds then the browser can stop waiting and the transaction can be
continued as normal but the threeDSResponse field should be returned indicating the timeout by
including a threeDSMethodData element with the value of 'timeout', for example,
“threeDSResponse[threeDSMethodData]=timeout”
V2.00
- 37 -
GATEWAY
INTEGRATION GUIDE
threeDSPolicy No1 3DS Policy used. Refer to appendix A-19.4 for further
details.
1 Overrides any Merchant Account setting configured via the Merchant Management System (MMS).
2 Not required for Hosted Integration
3 Some browser configuration options are mandatory if the corresponding device detail fields are not provided.
V2.00
- 38 -
GATEWAY
INTEGRATION GUIDE
threeDSEnrolled If 3DS enabled The 3DS enrolment status for the credit card.
Refer to appendix A-3 for details.
threeDSAuthenticated If 3DS enrolled The 3DS authentication status for the credit card.
Refer to appendix A-3 for details.
threeDSXID If 3DS The unique identifier for the transaction in the 3DS
authenticated system. Refer to appendix A-3 for details.
Note: If 3-D Secure is not enabled for the Merchant Account, then any 3-D Secure authentication
fields sent in the request are ignored and the transaction is processed as normal without 3-D
Secure.
When an external 3-D Secure provider is used then you are responsible for deciding whether to
continue at the different 3-D Secure stages and any preferences provided in the MMS or using the
threeDSCheckPref request field are ignored.
If the external provider returns an authentication status of ‘R’ then you must not continue with the
transaction either with or without 3-D Secure. Do not attempt to send a
threeDSAuthentication status of ‘R’ expecting the Gateway to reject the transaction.
V2.00
- 39 -
GATEWAY
INTEGRATION GUIDE
threeDSResponse Yes The data POSTed back from the ACS when the
challenge has completed.
1Note: It is only necessary to send the threeDSRef and the threeDSResponse in the continuation request, because the
threeDSRef will identify the Merchant Account and initial request. The message does not need to be signed. However, you
can send any of the normal request fields to modify or supplement the initial request. Any card details and transaction
amount sent in the second request must match those used in the first request, else the second request will fail with a
responseCode of 64442 (REQUEST MISMATCH).
V2.00
- 40 -
GATEWAY
INTEGRATION GUIDE
Some additional information will be automatically provided by the Gateway from standard
integration fields unless overridden by providing the associated option. The standard integration
field associated with each option is shown in brackets below the options field name. The standard
integration field should be used rather than the option, apart from the very rare circumstances
where the two must have different values.
A few additional information values, such as the Cardholder’s browser details1, are mandatory and
therefore either the standard integration field or the option must be provided. These fields are
marked as ‘Yes’ in the Mandatory column of the table below.
Further details what information is mandatory can be found at the end of this section.
The options must be formatted using the record or serialised record formats detailed in section
1.7.8.
accountAgeIndicator No Length of time that the cardholder has had the account
with the 3DS Requestor.
accountDate No Date that the cardholder opened the account with the
3DS Requestor. Accepted date format is YYYYMMDD.
1 The Hosted Integrations Payment Page will ignore any browser options and use its own details.
V2.00
- 41 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 42 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 43 -
GATEWAY
INTEGRATION GUIDE
browserTimeZone Yes1 The difference between UTC time and the cardholder's
(deviceTimeZone) browser local time in minutes.
V2.00
- 44 -
GATEWAY
INTEGRATION GUIDE
merchantFraudRate No Merchant’s fraud rate in the EEA (all EEA card fraud
divided by all EEA card volumes) calculated as per
PSD2 RTS. This value is sent to Mastercard only who
will not calculate or validate the fraud score.
V2.00
- 45 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 46 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 47 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 48 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 49 -
GATEWAY
INTEGRATION GUIDE
1 The Hosted Integrations Payment Page will ignore any browser options and use its own details.
2 Boolean values must be sent as the strings ‘true’ or ‘false’ unless JSON serialisation is used (refer to section 1.7.8)
3 This value is not mandatory if the browser doesn’t support JavaScript.
Some 3-D Secure v2 information is mandatory and must be provided using the following
threeDSOptions field or preferably using the associated standard integration field, in brackets,
apart from the very rare circumstances where the two must have different values.
If this mandatory information is not available, then 3-D Secure v2 will fail and, when possible,
fallback to using 3-D Secure v1 (refer to section 5.7.1 for more details on fallback).
V2.00
- 50 -
GATEWAY
INTEGRATION GUIDE
• browserScreenColourDepth/browserScreenColorDepth (deviceScreenResolution)
• browserScreenWidth (deviceScreenResolution)
• browserScreenHeight (deviceScreenResolution)
• browserTimeZone (deviceTimeZone)
V2.00
- 51 -
GATEWAY
INTEGRATION GUIDE
These fields will be returned in addition to the request fields from section 5.5.1 and the basic
response fields in section 2.2.
threeDSPolicy If available The unique identifier for the transaction in the 3DS
system.
threeDSVETimestamp If 3DS enabled The time the card was checked for 3DS enrolment
and any initial challenge determined.
threeDSEnrolled If 3DS enabled The 3DS enrolment status for the credit card. Refer
to appendix A-3 for details.
threeDSURL If 3DS enrolled The URL of the ACS to which the challenge data
should be sent via a HTTP POST request from the
Cardholder’s browser.
threeDSRequest If 3DS enrolled Record containing the name/value pairs that should
be sent to the ACS via HTTP POST request from the
Cardholder’s browser.
V2.00
- 52 -
GATEWAY
INTEGRATION GUIDE
These fields will be returned in addition to the request fields from section 5.5.1; any continuation
request fields from section 5.5.3; any challenge response fields from section 5.6.1; and the basic
response fields in section 2.2.
threeDSXID If 3DS enabled The unique identifier for the transaction in the 3DS
system.
threeDSVETimestamp If 3DS enabled The time the card was checked for 3DS enrolment
and any initial challenge determined.
threeDSEnrolled If 3DS enabled The 3DS enrolment status for the credit card. Refer
to appendix A-3 for details.
threeDSCATimestamp If 3DS enrolled The time the last challenge was checked.
threeDSAuthenticated If 3DS enrolled The 3DS authentication status for the credit card.
Refer to appendix A-3 for details.
V2.00
- 53 -
GATEWAY
INTEGRATION GUIDE
threeDSErrorCode If 3DS error Any error response code returned by the ACS if
there is an error in determining the card’s 3DS
status.
threeDSErrorDescription If 3DS error Any error response description returned by the ACS
if there is an error in determining the card's 3DS
status.
threeDSResponseMessage Always Any error message relating to the outcome of the 3-D
Secure processing stage.
V2.00
- 54 -
GATEWAY
INTEGRATION GUIDE
Note: If 3-D Secure is not enabled for the Merchant Account, then any 3-D Secure authentication
fields sent in the request are ignored and the transaction is processed as normal without 3-D
Secure.
V2.00
- 55 -
GATEWAY
INTEGRATION GUIDE
Any failure must be due to technical reasons only and never because the Cardholder entered their
credentials incorrectly. A failure to provide the correct credentials is a successful 3-D Secure
request and the transaction will continue with a threeDSAuthenticated value of ‘N’.
Failures could be due to invalid or missing request fields or options required by the higher 3-D
Secure version or by external problems with the 3-D Secure system, such as communication
errors with the Directory Server.
When fallback occurs, this will be indicated by the threeDSVersion response field and the
fallback and fallbackReason entries in the threeDSDetails response field.
To help prevent fallback please ensure that you provide accurate details about the Cardholder’s
device, using the threeDSOptions document in section 5.5.4 or the device fields documented in
section 17.7. Also ensure any extra threeDSOptions provided are accurate along with any
merchantName and merchantWebsite. You may find that you will need to provide values
containing standard alpha-numeric characters only and do not include accented characters or
other language specific characters. You must also ensure that the Merchant Account has a valid
Merchant Category Code configured or that you pass a valid merchantCategoryCode field in
your request.
For more details on how to use 3-D Secure to maintain PSD2 SCA Compliance please refer
Appendix A-19.4.
V2.00
- 56 -
GATEWAY
INTEGRATION GUIDE
6 Risk Checking
6.1 Background
The Gateway is integrated with Kount, the leading solution for digital fraud prevention.
If you have an existing account with Kount, or sign up for one, you can request that the Gateway
pass your transactions to them for risk checking before they are sent to the Acquirer for
authorisation.
Kount’s patented fraud prevention technology combines device fingerprinting; supervised and
unsupervised machine learning; a robust policy and rules engine; business intelligence tools; and
a web-based case-management and investigation system.
Their team of experts can help you understand and identify the rules necessary to optimise your
protection, as well as provide ongoing support. To get the most out of your investment, you may
want to dedicate an individual or a team to monitor your rules and ensure they continue to work as
intended.
The risk checking preferences can be configured per Merchant Account within the Merchant
Management System (MMS). These preferences can be overridden per transaction by sending
new preferences as documented in section 6.4.1. You must use the Kount management portal to
configure your risk parameters and thresholds.
Risk checking is an advanced feature and must be enabled on your Merchant Account before it can be
used. Please contact support if you wish to have it enabled.
V2.00
- 57 -
GATEWAY
INTEGRATION GUIDE
• The checks can be managed independently, allowing you the utmost control over how the
results are used.
• The checks can be configured to decline the transaction automatically where required.
• Leverage the ability to review transactions and decide what course of action to take.
• The checks can reduce chargebacks by blocking transactions made without the
Cardholder’s consent that would have resulted in the Cardholder raising a chargeback to
recover the fraudulent transaction amount.
• Providing enhanced risk checking increases Customer confidence and thus increases the
likelihood of their making a purchase.
6.2.2 Limitations
• Checking cannot prevent all fraudulent transactions and could even prevent some non-
fraudulent transactions.
• You will have to spent time analysing your transactions and establishing fraud rules.
V2.00
- 58 -
GATEWAY
INTEGRATION GUIDE
6.3 Implementation
When risk checking is required, each transaction will be sent to Kount for checking and the result
of the check will be returned in the riskCheck response field with one of the following values:
• not known - the checks could not be performed due to our error
• not checked - the checks could not be performed by Kount
• approve - the transaction is not risky and should proceed
• decline - the transaction is risky and should be declined
• review - the transaction is risky but proceed with caution
• escalate - the transaction is risky but proceed with caution
The actions to take for each riskCheck response can be configured for the Merchant Account,
using the Merchant Management System. Alternatively, the preferred actions can be passed with
the transaction request in the riskCheckPref field. The possible actions are as follows:
• continue - continue processing as normal
• authonly - authorise only, don't capture
• decline1 - decline without reason
• decline2 - decline with reason
• finished - abort with reason
The continue action allows the transaction to continue as normal and be sent to the Acquirer for
authorisation. A riskCheck value of approve will always be treated as if the action was
continue, regardless of whether the preferences say otherwise.
The authonly action allows the transaction to be authorised but not automatically captured giving
you time to review it and decide whether you want to take the risk and capture the transaction or
assume it to be fraudulent and cancel it.
The decline1 and decline2 actions will cause the transaction to be declined. Both decline the
transaction and return with a responseCode of 5 (DECLINED) and a responseMessage of
‘DECLINED’ or ‘RISK DECLINED’ respectively. The first action should be used if you don’t wish to
alert the Customer to the fact that you suspected that their transaction was fraudulent and
declined it for that reason.
The finished action will abort the transaction, causing it to return with a responseCode of either
65857 (RISK_CHECK_ERROR) or 65862 (RISK_CHECK_DECLINED) depending on whether an
error prevented the transaction from being checked by Kount, resulting in a riskCheck value of
‘not known’ or ‘not checked’.
The riskCheckPref field can be provided in the request to override any settings configured in
the Merchant Management System (MMS) for this Merchant Account. The value should be a
comma separated list of result=actions pairs. If a result is not specified in the list, then an action of
decline1 is assumed. For example: ”decline=decline1,review=authonly,escalate=authonly”.
V2.00
- 59 -
GATEWAY
INTEGRATION GUIDE
1 Overrides any Merchant Account setting configured via the Merchant Management System (MMS).
V2.00
- 60 -
GATEWAY
INTEGRATION GUIDE
SESS Unique Session ID1. Used to link to Kount’s browser device data collector.
V2.00
- 61 -
GATEWAY
INTEGRATION GUIDE
(customerPhone)
V2.00
- 62 -
GATEWAY
INTEGRATION GUIDE
1 SESS, the unique session id, is automatically sent from the Kount Device Collector loaded in the Hosted Payment Page.
For further information on the options, refer to the Kount Integration documentation:
https://kount.github.io/docs/ris-data-submission/.
V2.00
- 63 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 64 -
GATEWAY
INTEGRATION GUIDE
7 Payment Facilitators
7.1 Background
If you are a Payment Facilitator (PayFac/PF) or Independent Sales Organisation (ISO), then you
must send additional fields to identify yourself and your sub-merchants.
These fields must be sent with every new transaction; however, they can be cloned from an
existing transaction if using an xref as described in appendix A-17.
Payment Facilitator support is not available with all Acquirers. Please contact support to find out if
your Acquirer supports it and what fields are required.
V2.00
- 65 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 66 -
GATEWAY
INTEGRATION GUIDE
The merchant category code 6012 is related to payments taken for financial institutions, primarily
those merchants that deal with loan payments or other credit-related activities. According to Visa,
this is the most fraudulent merchant category in the UK market due to compromised debit card
details’ being used to pay or transfer balances to other cards. Acquirers are therefore unable to
confirm whether a payment is genuine, despite matching the full CVV2 with AVS.
To address this situation, issuing banks have requested additional payment information to be
provided with payment requests in order to verify that the cardholder is knowingly entering into a
credit-related contractual agreement with the merchant.
If you are a Merchant who has been assigned the MCC 6012 you must collect the following data
for the primary recipient for each UK domestic Visa or Mastercard transaction1.
• Unique account identifier for the loan or outstanding balance funded. For example, the loan
account number or the PAN (Primary Account Number) if it is a credit card balance.
• Last name (family name)
• Date of Birth (D.O.B)
• Postcode
Primary recipients are the entities (people or organisations) that have a direct relationship with the
financial institution. Also, these primary recipients have agreed to the terms and conditions of the
financial institution.
The new fields are not currently mandatory. However, some Acquirers are now declining
transactions that are missing this information and so we recommend the information is always
provided, even if your Acquirer doesn’t currently mandate them.
If you are not a UK MCC 6012 Merchant or the payment is not a UK domestic one, then you need
not provide these additional authentication details though the Gateway will accept them if you do.
1The additional details are currently only required by Visa and Mastercard however we recommend sending for all card
types in order to be prepared for when other card Schemes follow suite.
V2.00
- 67 -
GATEWAY
INTEGRATION GUIDE
1 Only required if the Merchants Category Code is not configured on your gateway account.
V2.00
- 68 -
GATEWAY
INTEGRATION GUIDE
9 Billing Descriptor
9.1 Background
The Billing Descriptor is how your details appear on the Cardholder’s statement. It is set up with
the Acquirer when the Merchant Account is opened. It is used by the Cardholder to identify who a
payment was made to on a particular transaction.
Selecting a clear Billing Descriptor is important for you to avoid a chargeback when the Cardholder
does not recognise the name on the transaction.
Not all Acquirers accept Dynamic Descriptors and, for those that do, the required format varies.
Often, your Merchant name is shortened to three (3) letters, followed by an asterisk (*), followed
by a short description of the service or product that the business provides. This field typically has a
limit of twenty-five (25) characters including the phone number.
For more information on whether your Acquirer allows Dynamic Descriptor and the format in which
they should be sent, please contact customer support.
V2.00
- 69 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 70 -
GATEWAY
INTEGRATION GUIDE
10 Surcharges
10.1 Background
Surcharges are an additional charge that you can apply to the transactions that are processed
through your Merchant Account.
Transactions that are sent for authorisation are subject to processing charges from your Acquirer
and surcharges enable you to pass the processing charges that you incur on to your Customers.
You may, for example, be charged a fixed amount for debit card transactions and a percentage
amount for credit card transactions. Consequently, the Gateway gives you the option to add both a
fixed amount and percentage amount when applying a surcharge.
Surcharges should only be added to cover the processing charges that are incurred by your
business. There is no Gateway imposed limit to the value of the surcharges that can be added to
your transaction, although there are legal requirements. As a rule, the surcharge must not exceed
the processing costs that you pay.
Some businesses apply surcharges to cover all the costs that they incur; while others use the
surcharges to subsidise the charges.
Surcharge amounts may be limited or illegal in your jurisdiction. For example, surcharging is illegal in
the European Union and many US states. It is up to you to check with your Acquirer and comply with
any laws.
Surcharges is an advanced feature and must be enabled on your Merchant Account before it can be
used. Please contact support if you wish to have it enabled.
V2.00
- 71 -
GATEWAY
INTEGRATION GUIDE
10.2 Implementation
10.2.1 Surcharge Rules
The surchargeRules field allows you to provide multiple rules specifying what surcharges
should be applied to a transaction. If a transaction matches multiple rules, then the most specific
rule will be used; or the first in the list.
cardType Yes One or more 2-letter card type codes for which this rule applies (see)
The following two card type codes are also supported, in addition to the codes
listed in appendix A-11:
CC – matches any credit card.
DD – matches any debit card.
surcharge Yes Surcharge amount in minor (N) or major (N.N) units or a percentage (N%).
The surcharge rules should be passed in a sequential array of records, either as nested records or
serialised records as described in section 1.7.8. The record field names are case sensitive.
The Gateway doesn't usually validate that any amount and grossAmount fields are the same
and that any netAmount, taxAmount and taxRate tally. However, in order to update them
when a surcharge is applied, the amount and grossAmount must match and the correct
taxRate must be provided or be able to be calculated from one or more of the other fields.
Failure in this respect can cause the Gateway to return one of the following responseCode
values; 66360 (INVALID_GROSSAMOUNT), 66361 (INVALID_NETAMOUNT), 66338
(INVALID_TAXAMOUNT), 66362 (INVALID_TAX_RATE).
If the request contains a surchargeAmount field, then the Gateway will assume that surcharging
has already been performed externally and will not attempt to apply any further surcharges.
V2.00
- 72 -
GATEWAY
INTEGRATION GUIDE
1 Overrides any Merchant Account setting configured via the Merchant Management System (MMS).
V2.00
- 73 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 74 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 75 -
GATEWAY
INTEGRATION GUIDE
This functionality is enabled globally on a per Merchant Account basis using the Merchant
Management System (MMS). This global setting can also be overridden per transaction if
required, using the customerReceiptsRequired field.
Customer receipts require the Customer to provide an email address; if no email address is
provided, using the Hosted Payment Page or the customerEmail field, then no receipt will be
sent.
This functionality is enabled globally on a per Merchant Account basis, using the Merchant
Management System (MMS). This global setting can also be overridden per transaction if
required, using the notifyEmailRequired field.
Merchant notifications require you to provide an email address; if no email address is provided,
using the Merchant Management System (MMS) or the notifyEmail field, then no notification
will be sent.
V2.00
- 76 -
GATEWAY
INTEGRATION GUIDE
1 Overrides any Merchant Account setting configured via the Merchant Management System (MMS).
V2.00
- 77 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 78 -
GATEWAY
INTEGRATION GUIDE
12 Credentials on File
12.1 Background
You may need to repeat a payment or perform a new payment using payment details previously
requested from the Customer and stored by either yourself or the Gateway. These payment details
could be stored in previous transaction or in the Gateway wallet. These repeat payments could be
one off payments, scheduled recurring payments, or repeats due to authorisation problems or
industry requirements. All must be correctly flagged to allow the payment network to process
them.
The stored details, or credentials, are termed Credentials on File (COF) and refer to any payment
details (including, but not limited to, an account number or payment token) that the Consumer has
authorised you to store to perform future transactions without the need for them to enter their
payment details again.
These transactions must always be identified with the reason for storing or using the stored
credentials and who initiated the transaction – the Consumer (CIT) or the Merchant (MIT).
You may store the credentials and send them with the future transaction, or you may store the
details in the Gateway’s Wallet as described in section 19 or by taking advantage of the Payment
Tokenisation feature of the Gateway as described in appendix A-16. Either way you must tell the
Gateway of your intentions, it will not assume that just because you have asked, for example, to
store credentials in the Wallet that those are legitimate stored credentials and follow all the
requirements laid out below.
Note: Credentials stored to complete a single transaction (or a single purchase) for a Consumer,
including multiple authorisations related to that particular transaction or future refunds are not
considered stored credentials and can be stored and used without the following the above rules.
Note: A new recurring transaction will be a clone of the cross-referenced transaction, including any
stored credentials details except for any new data provided in the new transaction. If the new
transaction provided different payment details, then any stored credentials in the cross-referenced
transaction cannot be used. The cloneFields request field can also be used to control which
fields in the cross-referenced transaction are used in the repeat transaction (refer to appendix A-
17).
V2.00
- 79 -
GATEWAY
INTEGRATION GUIDE
A Consumer Initiated Transaction is one whose action field is one of PREAUTH, SALE or
VERIFY and whose type is one of 1 (ECOM) or 2 (MOTO).
To indicate that the card details are to be stored as, or were stored as, Credentials on File then
send the rtAgreementType field as one of the following values:
• cardonfile – card details stored as Credential on File
• recurring – initial payment as the start of a recurring payment agreement.
• instalment – initial payment as the start of an instalment payment agreement.
If the card details are cloned from an existing transaction or loaded from a Gateway Wallet which
also stored the Credentials on File, then the transaction will be flagged as subsequent use of
stored credentials rather than first use of them1.
If the transaction is the first in a recurring or instalment sequence then the optional
rtSequenceCount field can be used to specify how many transactions will be taken in total, with
a value greater than 1, and any optional rtSequenceNumber field specifying the which
transaction it is in the sequence will be expected to have a value of 0.
1 For flagging of subsequent use, the existing credentials will usually need to have been stored with the same Acquirer.
V2.00
- 80 -
GATEWAY
INTEGRATION GUIDE
Refer to section 13 for information on how the Gateway can be instructed to take Merchant
Initiated recurring transactions automatically, according to a pre-determined schedule.
• Unscheduled Credential on File (UCOF): A transaction using a stored credential for a fixed
or variable amount that does not occur on a scheduled or regularly occurring transaction
date, where the Consumer has provided consent for the merchant to initiate one or more
future transactions. An example of such a transaction is an account auto-top up transaction.
The Gateway classifies the first two types of instalment and recurring payments as Continuous
Authority (CA) payments and the third type as a normal Cardholder not present payments.
Different Acquirers may use different classifications, but the Gateway will handle this and send the
classification expected by the Acquirer.
V2.00
- 81 -
GATEWAY
INTEGRATION GUIDE
• Reauthorization: You can initiate a reauthorization when the completion or fulfilment of the
original order or service extends beyond the authorization validity limit set by the card
scheme.
• Delayed Charges: Delayed charges are performed to make a supplemental account charge
after original services have been rendered and payment has been processed.
• No Show: Consumers can use their payment credentials to make a guaranteed reservation
with certain merchant segments. A guaranteed reservation ensures that the reservation will
be honoured and allows you to perform a No Show transaction to charge the Consumer a
penalty according to your cancellation policy. If no payment is made to guarantee a
reservation, then it is necessary to perform a VERIFY Consumer Initiated Transaction at the
time of reservation to be able perform a No Show transaction later.
- 82 -
GATEWAY
INTEGRATION GUIDE
A Merchant Initiated Transaction is one whose action field is one of PREAUTH, SALE or
VERIFY and whose type is one of 2 (MOTO) or 9 (CA) depending on the category.
To indicate the type of MIT, send the rtAgreementType field as one of the following values:
• recurring – subsequent payment as the start of a recurring payment agreement (CA).
• instalment – subsequent payment as the start of an instalment payment agreement (CA).
• unscheduled – subsequent payment not to a fixed schedule (MOTO)
• incremental – subsequent payment to increment initial amount authorised (MOTO)
• resubmission – subsequent payment due to failed initial payment (MOTO)
• reauthorisation – subsequent payment to refresh expired initial payment (MOTO)
• delayedcharges – subsequent payment for additional charges (MOTO)
• noshow – subsequent payment as penalty for missed reservation (MOTO)
In addition, the optional rtSequenceCount field can be used to specify how many transactions
will be taken in total, with a value greater than 1, and the optional rtSequenceNumber field can
be used to specify which transaction this is in the sequence, with a value greater than 0.
The xref of the initial Consumer Initiated Transaction must be provided as follows:
• For standing order MITs the initial authorisation must have been a successful Consumer
Initiated Transaction with Credentials on File. This MIT will be a subsequent use of those
Credentials on File. For recurring and instalment MITs the initial authorisation must have
used the same rtAgreementType. The xref can be to the previous MIT in which case the
Gateway will follow the chain of transactions back to the initial CIT.
• For industry practice MITs the initial authorisation must be successful (apart from for a
resubmission) but need not have Credentials on File. For example, it may not be known at
the time of the initial authorisation that the MIT would be required and so the initial
authorisation would not necessarily have stored the Credentials on File. This is an example
of when an industry practice Merchant Initiated Transaction does not require a stored
credential
Note: For compatibility with existing practices, Instalment Payments and Recurring Payments
MITs use Continuous Authority (CA) type transactions while other MITs Mail Order/Telephone
Order (MOTO) type transactions. This use of MOTO is different to its use with a Consumer
Initiated Transaction (CIT).
V2.00
- 83 -
GATEWAY
INTEGRATION GUIDE
For backwards compatibility, the Gateway will try to automatically identify if a transaction is CIT or
MIT from the values provided for the action, type and rtAgreementType fields.
You may also pass the initiator field in the request to force a classification. This can be used
if the Gateway is unable to correctly determine classify the transaction. If, however, the requested
classification is incompatible with the provided request fields then the transaction will fail with a
responseCode of 66944 (INVALID INITIATOR).
The initiator field will be returned in the response with either the value passed in the request
or the automatically identified value.
V2.00
- 84 -
GATEWAY
INTEGRATION GUIDE
An RTA can be configured easily and quickly, using the Merchant Management System (MMS). An
RTA can also be set up while performing the initial transaction request, by including the integration
request fields described in section 13.3. The RTA is only set up in the transaction results in a
successful payment authorisation.
The transaction should be either SALE or VERIFY transaction and the rtAgreementType field
should be provided to indicate whether the transactions are part of a recurring or instalment.
Merchants who use this system to implement billing or subscription type payments must use
recurring or instalment type Continuous Authority (CA) transactions to comply with Card
Payment Scheme practices. Your Acquirer may refuse to accept the recurring transactions if they
are not subject to an agreement between yourself and your Customer.
Refer to section 12 for more information on the different types of repeat or recurring transactions.
V2.00
- 85 -
GATEWAY
INTEGRATION GUIDE
13.2 Scheduling
There are two different types of scheduling available when requesting the Gateway to take
recurring transactions automatically on the Merchant’s behalf. In addition, a start date can be
provided to allow for a recurring subscription with an initial free trial period.
Fixed scheduling is specified by providing an rtScheduleType field with a value of ‘fixed’ and
providing the rtCycleDuration, rtCycleAmount and rtCycleCount fields to define the
interval at which transactions should be taken and the number of transactions to take.
An rtCycleCount field value of 0 can be provided to indicate that transactions should be taken
ad-infinitum until the RTA is stopped.
The schedule records should be passed in a sequential array of records, either as nested records
or serialised records as described in section 1.7.8. The record field names are case sensitive.
V2.00
- 86 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 87 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 88 -
GATEWAY
INTEGRATION GUIDE
It allows your Customer to pay in their currency, but you will receive the funds in the original
transaction currency. You can profit from a mark-up on the exchange rate used, as negotiated with
your Acquirer and DCC Provider.
Dynamic Currency Conversion is not available with all Acquirers and must be enabled on your
Merchant Account before it can be used. Please contact support to find out whether your Acquirer
supports it and if it can be enabled on your Merchant Account.
Dynamic Currency Conversion is supported by the Hosted and Direct Integrations. It is not
supported by the Batch Integration.
V2.00
- 89 -
GATEWAY
INTEGRATION GUIDE
14.2.2 Limitations
• Cardholders can be sceptical of use due to previously unfavourable exchange rates’ being
offered.
• There may be extra costs involved, though you may also find that you can recover this from
your conversion mark-up.
V2.00
- 90 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 91 -
GATEWAY
INTEGRATION GUIDE
If the Gateway determines that the transaction is not eligible for DCC or no conversion rate is
available, then it will continue and process it as a normal transaction without DCC.
If a rate was checked for but none was available, then the transaction response will contain DCC
conversion details but the dccRate field will be zero.
If the Gateway determines that the transaction is eligible, it will respond with a responseCode of
65890 (DCC REQUIRED) and the response will include details of the DCC offer to ask the
Cardholder whether they wish to accept, together with a dccRef transaction continuation
reference.
V2.00
- 92 -
GATEWAY
INTEGRATION GUIDE
1 Any other value will use the preference set in the Merchant Management System (MMS).
dccRef Yes The value of the dccRef field in the initial Gateway
response.
1It is only necessary to send the dccRef and the dccAccepted in the continuation request, because the dccRef will identify
the Merchant Account and initial request. However, you can send any of the normal request fields to modify or supplement
the initial request. Any card details and transaction amount sent in the second request must match those used in the first
request, else the second request will fail with a responseCode of 64442 (REQUEST MISMATCH).
V2.00
- 93 -
GATEWAY
INTEGRATION GUIDE
Note: If DCC is not enabled for the Merchant Account then any DCC conversion fields sent in the
request are ignored and the transaction is processed as normal without DCC. If DCC is enabled
but the transaction is otherwise not eligible for DCC conversion, then any DCC field sent in the
request will result in an error response.
V2.00
- 94 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 95 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 96 -
GATEWAY
INTEGRATION GUIDE
15 Purchase Data
15.1 Background
The Gateway can be sent advanced purchase information with each transaction, where required.
The Gateway provides a number of fields that you can use to store advanced purchase
information about the transaction, including details on individual items purchased. These fields are
only sent to the Acquirer if needed. The stored data can be obtained by sending a QUERY
request.
The details may also be used for advanced purposes, such as displaying shopping cart
information on the Masterpass wallet, or PayPal checkout.
With American Express, you can provide tax or discount reason (but not both). If taxAmount is
provided, then taxReason is used; if discountAmount is provided, then discountReason is
used. If both are provided, then taxReason is used.
Only the description, quantity, and amount of the first six line item details are sent to American
Express.
At present, this information is not sent to the Acquirer, unless needed, but future enhancements to
the Gateway may include sending such information as Level 2 or 3 Purchasing data as defined by
the relevant card schemes.
V2.00
- 97 -
GATEWAY
INTEGRATION GUIDE
The following request fields may be sent to provide more information on the purchased items:
V2.00
- 98 -
GATEWAY
INTEGRATION GUIDE
The purchased items can be passed as either individual itemXXField fields; or as a single
items field whose value is a sequential array of nested records as described in section 1.7.8.
Both formats cannot be used together. The presence of an items field will cause the Gateway to
ignore any individual fields.
The Gateway does not currently support items to be formatted as a serialised array of records.
Note: no attempt is made to check that any gross, net and tax amounts are correct with respect to
each other. It is the sender’s responsibility to ensure alternative amount formats are correct.
Line item fields can either be sent ‘flat’ using field names containing the item row number as a
sequential number from 1 to 99; or be sent using nested arrays of the form items[XX][field]
where XX is the row number from 1 to 99 and field is the field name from the above table
without the itemXX prefix and starting with a lowercase first letter. For example, the tax rate for
item 5 can be sent either as item5TaxRate; or as items[5][taxRate]. The two formats
should not be mixed. If a request field of items is seen, then the ‘flat’ fields are ignored.
V2.00
- 99 -
GATEWAY
INTEGRATION GUIDE
16 Custom Data
You may send arbitrary data with the request by appending extra fields, which will be returned
unmodified in the response. These extra fields are merely ‘echoed’ back and not stored by the
Gateway.
Caution should be made to ensure that any extra fields do not match any currently documented
fields or possible future fields. One way to do this is to prefix the field names with a value unique to
you, the Merchant.
If the request contains a field that is also intended as a response field, then any incoming request
value will be overwritten by the correct response value.
The Gateway may add new request and response fields at any time and so your integration
must take care not to send request fields that may conflict with future Gateway fields and
be able to ignore response fields which it doesn’t yet understand.
You can also use the merchantData field to store custom data with the transaction. This stored
data can then be retrieved at a later date, using a QUERY request. Complex data can be stored
as per the details for nested records in section 1.7.8, however the Gateway does not currently
support this fields to be provided in the serialised record format. Alternatively, you can serialise the
data before storing and unserialise it on retrieval.
V2.00
- 100 -
GATEWAY
INTEGRATION GUIDE
17 Advanced Data
The Gateway provides a number of fields that you can use to store information about the
transaction. These fields are only sent to the Acquirer if needed. The stored data can be obtained
by sending a QUERY request.
If AVS checks are in use, then the Customer and Cardholder are assumed to be the same person
and the address and postcode fields are taken as being the registered billing address of the card.
V2.00
- 101 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 102 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 103 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 104 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 105 -
GATEWAY
INTEGRATION GUIDE
Note: no attempt is made to check that any gross, net and tax amounts are correct with respect to
each other. It is the sender’s responsibility to ensure alternative amount formats are correct.
V2.00
- 106 -
GATEWAY
INTEGRATION GUIDE
deviceTimeZone No1 Time zone offset in minutes between UTC and the
Consumer’s device. The offset is positive if the local
time zone is behind UTC and negative if it is ahead.
V2.00
- 107 -
GATEWAY
INTEGRATION GUIDE
1 This field is mandatory for 3-D Secure v2 unless an alternative is provided via the threeDSOptions field.
V2.00
- 108 -
GATEWAY
INTEGRATION GUIDE
18 Acquirer Data
The Gateway supports the passing of Acquirer specific data where needed by an individual
Acquirer to provide additional or non-standard features.
When supported, this data can be passed in the acquirerOptions request field, which must be
provided using the record or serialised record format detailed in section 1.7.8.
Please contact our customer support team if you need information about what options can be
provided to your Acquirer.
The Gateway also supports the returning of Acquirer specific details in the request in situations
where the Gateway considers the data to be of value.
When supported, this data will be returned in the acquirerResponseDetails response field,
which will be returned using the record format detailed in section 1.7.8.
In addition to this the Gateway will return the original response code and message received from
the Acquirer and any transaction referenced provided by the Acquirer. This later reference can
help you identify the transaction when you have access to the Acquirers merchant management
portal or need to contact them to query a transaction.
The original Acquirer response code may not be numeric and information on these codes will need
to be requested from the Acquirer.
The Gateway may support new acquirer options and return new acquirer details at any time
and so your integration must be able to handle such changes and not reject unknown
fields.
V2.00
- 109 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 110 -
GATEWAY
INTEGRATION GUIDE
19 Gateway Wallet
19.1 Background
The Gateway supports an internal digital Wallet that is available to all Merchants using the
Gateway.
The Gateway allows you to store your Customer’s payment card, billing and delivery address
details and other information securely encrypted in its internal Wallet. You can then allow your
Customer to select from stored payment cards to check out faster on your website.
Management of this Wallet is done using the Gateway’s REST API. However, you can use the
Hosted, Direct or Batch Integrations to perform transactions, using cards and addresses stored in
the Wallet; or to store new cards and address used with successful transactions.
V2.00
- 111 -
GATEWAY
INTEGRATION GUIDE
• Customers can select from previously stored details, making the checkout process more
streamlined, resulting in fewer abandoned carts and thus increasing sales.
• Compatible with existing card base fraud solutions such as Address Verification Service
(AVS), 3-D Secure and third-party fraud providers.
• The Wallet transactions are controlled within the Merchant Management System (MMS) in
the same manner as normal card transactions.
• Stored cards are assigned a Card Token which is fully LUHN checkable PAN ending in the
same last 4 digits as stored card and thus can be used to replace the PAN in any system
that is expecting to store PANs and not arbitrary card identifiers.
19.2.2 Limitations
• The payment details are stored internally by the Gateway and not available for use with
other Gateway Merchants or other payment gateways.
V2.00
- 112 -
GATEWAY
INTEGRATION GUIDE
Customers who have payment details already saved will have the option to select from those
details rather than having to renter them. Customers will also have the option to delete stored
details1.
The details are only saved if the transaction is successful, ensuring that the Wallet is not filled up
with invalid payment details.
The details requiring to be stored in the Wallet are validated when the transaction is performed,
prior to any authorisation with the Acquirer. If any of the details are invalid, then the transaction will
be aborted with a responseCode of 66304 (INVALID_REQUEST) and a responseMessage
indicating which data could not be stored in the Wallet. Any failure that occurs post authorisation
will not abort the transaction but will be available in the appropriate xxxxStoreResponseCode
response fields.
The walletOwnerRef field can be used to assign a unique Customer reference to the Wallet,
allowing you to identify which of your Customers owns the Wallet. This could be the Customer
reference you use within your own Customer accounts or Shopping Cart software. You must
ensure that this value is less than 50 characters, or the transaction will be aborted with a
responseCode of 65xxx (INVALID_WALLETCUSTOMERREF).
1 There is no option to modify stored payment details. However, the Customer can delete them and then restore them.
V2.00
- 113 -
GATEWAY
INTEGRATION GUIDE
Using stored payment details is similar to performing cross-referenced transactions where the
payment details are cloned from a previous transaction1. However, in this case the payment
details are taken from the Wallet and not a previous transaction.
The details are only saved if the transaction is successful, ensuring that the Wallet is not filled up
with invalid payment details.
The details requiring to be stored in the Wallet are validated when the transaction is performed
prior to any authorisation with the Acquirer. If any of the details are invalid, then the transaction will
be aborted with a responseCode of 66304 (INVALID_REQUEST) and a responseMessage
indicating which data could not be stored in the Wallet. Any failure that occurs post authorisation
will not abort the transaction but will be available in the appropriate xxxxStoreResponseCode
response fields.
The walletOwnerRef field can be used to assign a unique Customer reference to the Wallet
allowing you to identify which of your Customers owns the Wallet. This could be the Customer
reference you use within your own Customer accounts or Shopping Cart software. You must
ensure that this value is less than 50 characters, or the transaction will be aborted with a
responseCode of 65xxx (INVALID_WALLETCUSTOMERREF).
1 Refer to appendices A-15 through to A-17 for details on cross referenced transactions and cloning.
V2.00
- 114 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 115 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 116 -
GATEWAY
INTEGRATION GUIDE
If new items are stored in the Wallet, then their identifiers will be returned in the appropriate
walletID, cardID, customerAddressID and deliveryAddressID together with any values
provided for or assigned by default to the other item fields.
Failure to store any of the details in the Wallet will be reported using the appropriate
xxxxStoreResponseCode response field.
V2.00
- 117 -
GATEWAY
INTEGRATION GUIDE
20 Masterpass Wallet
20.1 Background
Masterpass is a digital wallet from Mastercard that is available to all Merchants using the
Gateway.
It allows customers to store their payment and shipping information in one central, secure location.
With Masterpass, customers can shop, click, and check out faster on your website.
Masterpass transactions process and settle just like credit card transactions. You can identify
Masterpass transactions in the Merchant Management System by their unique payment type logo,
which includes the credit card brand name at the bottom.
There are no additional fees for processing Masterpass transactions – pricing for Masterpass is
the same as your other credit card transactions.
Masterpass has upgraded to Mastercard’s new guest checkout option and Customers can no longer
sign up. As such this integration is subject to change.
Masterpass is an advanced feature and must be enabled on your Merchant Account before it can be
used. Please contact support if you wish to have it enabled.
Masterpass is supported by the Hosted and Direct Integrations. It is not supported by the
Batch Integration.
V2.00
- 118 -
GATEWAY
INTEGRATION GUIDE
• Customers can select from previously stored details, making the checkout process more
streamlined, resulting in fewer abandoned carts and thus increasing sales.
• Compatible with existing card base fraud solutions such as Address Verification Service
(AVS), 3-D Secure and third-party fraud providers.
• The Masterpass transactions are controlled within the Merchant Management System
(MMS) in the same manner as normal card transactions.
20.2.2 Limitations
• Your Customer will need a Masterpass Wallet with some stored card details in order to
make full use of this payment method.
• Repeat transactions using the retrieved payment details are supported but may require
permission from Masterpass.
V2.00
- 119 -
GATEWAY
INTEGRATION GUIDE
To customise the Masterpass Wallet experience, you may send various options in the
masterPassCheckoutOptions field in your initial request.
Additional information available from the Masterpass Wallet will be made available in the
masterPassCheckoutDetails response field.
Note: Custom Hosted Payment Pages might not support the displaying of the Masterpass button.
If you have a custom page that doesn’t support this, then you would need to contact support to
have your Hosted Payment Page upgraded.
V2.00
- 120 -
GATEWAY
INTEGRATION GUIDE
To customise the Masterpass Wallet experience, you may send various options in the
masterPassCheckoutOptions field in your initial request.
Additional information available from the Masterpass Wallet will be made available in the
masterPassCheckoutDetails response field.
If the Gateway is unable to find a suitable account, then the transaction will be aborted and it will
respond with a responseCode of 65569 (MASTERPASS_NOT_SUPPORTED).
At this point your server must redirect the Customer’s browser to the Masterpass Wallet at the
provided masterPassCheckoutURL. Alternatively, the masterPassCheckoutURL can be used
in conjunction with the Masterpass JavaScript code to implement a lightbox style Wallet that
allows the Merchants website to remain visible in the background. Further details on how to use
the Masterpass JavaScript SDK can be obtained from Masterpass.
V2.00
- 121 -
GATEWAY
INTEGRATION GUIDE
successful, the status will be ‘success’. Alternatively, if the checkout was cancelled the status will
be ‘cancel’.
If the continuation request contains any details that would normally be read from the Masterpass
Wallet, then these will take precedence and overwrite the Wallet details. Note: in such cases, the
transaction will no longer class as being a Masterpass transaction and will be treated by the
Acquirers as if the Wallet was not used.
If the chosen details cannot be retrieved or if the masterPassStatus field indicated that the
Wallet was cancelled, then the Gateway will return a responseCode of 65570
(MASTERPASS_CHECKOUT_FAILURE).
If the continuation request contains any details that would normally be read from the Masterpass
Wallet, then these will be ignored, and the Wallet details returned. Note: this is different from usual
processing, where incoming fields usually take precedence.
The outcome of this request will depend on the value of the masterPassStatus field and the
ability to communicate with Masterpass. On success, the Gateway will return a responseCode of
65571 (MASTERPASS_CHECKOUT_SUCCESS) and response will include the chosen payment
card and address details. If the Wallet was cancelled or if the chosen details cannot be retrieved,
then the Gateway will return a responseCode of 65570
(MASTERPASS_CHECKOUT_FAILURE).
Note: this stage can be repeated multiple times by including the masterPassOnly field with a
value of ‘Y’ each time. To complete the transaction, the final request must not contain the
masterPassOnly field or it must not have a value of ‘Y’.
V2.00
- 122 -
GATEWAY
INTEGRATION GUIDE
1These fields should be initialised with values received by your website when the wallet redirects to your
masterPassCallbackURL URL. If the checkout was cancelled, then only the masterPassStatus field need be sent to
the Gateway.
V2.00
- 123 -
GATEWAY
INTEGRATION GUIDE
requireLightboxCheckout Use the lightbox version of the Masterpass Wallet rather than the full
screen checkout when possible.
suppress3Ds Suppress Masterpass 3-D Secure processing. This allows the Gateway to
do the 3-D Secure processing using the chosen card details.
suppressShippingAddress Suppress the requirement for the Customer to select a shipping address
as well as payment card details.
suppressWalletSelector Suppress the ability to select alternative Wallet providers from within the
Masterpass Wallet.
V2.00
- 124 -
GATEWAY
INTEGRATION GUIDE
allowedCardTypes List of Masterpass card types to allow selection from within the Wallet.
Will be returned in the response from the card types configured for your
Merchant Account.
The deprecated options were originally used with v6 of the Masterpass API and the Gateway will
accept both the newer v7 option name and the original v6 option name regardless of the value of
any version option provided. The Gateway may return the correct name for the version when it
returns the masterPassCheckoutOptions in the initial response.
The nature of the URL returned in the masterPassCheckoutURL response field depends on
whether the Masterpass lightbox or full-page redirect checkout is required as specified using the
requireLightboxCheckout option. If the option is passed as 'true', then the URL will reference
the Masterpass JavaScript file that should be loaded to provide the code required to open the
lightbox style Wallet. The masterPassCheckoutOptions response values should then be
passed to the JavaScript call to open the lightbox. If the option is not passed or not 'true', then the
URL will be an address to redirect the Customer’s browser to in order to display the Masterpass
Checkout pages. This URL will have its query component initialised from any
masterPassCheckoutOptions request values, and any response values need not be used.
V2.00
- 125 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 126 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 127 -
GATEWAY
INTEGRATION GUIDE
1 The response will include Customer/billing address and delivery address details if provided by the Masterpass Wallet.
V2.00
- 128 -
GATEWAY
INTEGRATION GUIDE
21 PayPal Transactions
21.1 Background
PayPal is an additional payment method that is available to all Merchants using the Gateway who
have a PayPal account.
To use PayPal, you will be supplied with a separate PayPal Merchant Account that can be
grouped with your main Merchant Account using the account mapping facility as documented in
appendix A-7. This allows transactions to be sent using your main Merchant Account and then
routed automatically to the PayPal Merchant Account in the same mapping group.
It allows you to offer payment via PayPal in addition to normal card payments.
PayPal transactions will appear in the Merchant Management System (MMS) alongside any card
payments and can be captured, cancelled and refunded in the same way as card payments.
PayPal transactions can also be used for recurring billing but require you to indicate in the initial
transaction that it will be the basis for recurring billing and that a billing agreement will be entered
into between your Customer and PayPal when they agree to the payment.
PayPal transactions cannot be used for ad-hoc Credentials on File (COF) repeat transactions
unless a billing agreement has been set up.
For more information on how to accept PayPal transactions, please contact customer support.
PayPal is supported by the Hosted and Direct Integrations. It is not supported by the Batch
Integration.
V2.00
- 129 -
GATEWAY
INTEGRATION GUIDE
• The in-context PayPal Express Checkout helps improve conversion rates with an easier
way to pay without customers leaving your website.
• There are no extra costs for adding a PayPal Merchant Account. However, you will still be
liable for the PayPal transaction fees.
• The full PayPal transaction information is available and returned as part of the transaction.
• Transactions are controlled within the Merchant Management System (MMS) in the same
manner as normal card transactions.
21.2.2 Limitations
• You will need a PayPal account.
• Recurring transactions are not supported unless as part of a prearranged billing agreement.
• Independent refunds that are not tied to a previous sale transaction are not supported
without prior agreement.
• The PayPal Checkout cannot be opened from within a browser IFRAME and so care must
be taken to ensure that any PayPal Checkout button is not placed within such an IFRAME.
V2.00
- 130 -
GATEWAY
INTEGRATION GUIDE
To customise the PayPal Checkout experience, you may send various options in the
payPalCheckoutOptions field in your initial request.
Additional information available from the PayPal Checkout will be made available in the
checkoutDetails response field.
Note: Custom Hosted Payment Pages might not support the displaying of the PayPal Checkout
button. If you have a custom page that doesn’t support this, then you would need to contact
support to have your Hosted Payment Page upgraded.
V2.00
- 131 -
GATEWAY
INTEGRATION GUIDE
PayPal supports the normal payment and management actions. This section explains how to
make payment requests. Management requests are performed as detailed in section 3.
To customise the PayPal Checkout experience, you may send various options in the
checkoutOptions field in your initial request.
Additional information available from the PayPal Checkout will be made available in the
checkoutDetails response field.
The direct integration uses two complex fields to pass data between the PayPal Checkout and the
and the Gateway. The checkoutRequest field will be provided by the Gateway and is a record
whose name/value properties should be used with the PayPal JavaScript SDK to open the
Checkout. The corresponding checkoutResponse field should be returned to the Gateway and
must be a record containing name/value properties received from the Checkout when it redirects
the Cardholder’s browser back to the URL provided using the checkoutRedirectURL on
completion.
If the Gateway is unable to find a suitable account, then the transaction will be aborted and it will
respond with a responseCode of 66364 (INVALID PAYMENTMETHOD).
Otherwise, the Gateway will respond with a responseCode of 65826 (CHECKOUT REQUIRED)
and included in the response will be a checkoutURL field containing the URL required to load
Checkout and a checkoutRequest containing any data required to be sent to the Checkout. The
response will also contain a unique checkoutRef which must be echoed back in the continuation
requests.
V2.00
- 132 -
GATEWAY
INTEGRATION GUIDE
At this point your server must redirect the Customer’s browser to the provided checkoutURL.
Alternatively, the checkoutURL can be used in conjunction with the PayPal In-Context JavaScript
code to implement an In-context Checkout which allows the Merchants website to remain visible in
the background. Further details on how to use the In-Context Checkout are provided in the
PayPal guide at https://developer.paypal.com/docs/classic/express-checkout/in-
context/enable_in_context_checkout/.
Note: this stage can be repeated multiple times by including the checkoutOnly field with a value
of ‘Y’ each time. To complete the transaction, the final request must not contain the
checkoutOnly field or it must not have a value of ‘Y’.
V2.00
- 133 -
GATEWAY
INTEGRATION GUIDE
paymentMethod Yes1 Must contain the value ‘paypal’ in lower case letters
only.
1It is only necessary to send the checkoutRef and the checkoutResponse in the continuation request because the
checkoutRef will identify the Merchant Account and initial request. The message does not need to be signed. You can
send any of the normal request fields to modify or supplement the initial request – however, in this case the request
should be signed. The checkoutRedirectURL and checkoutOptions fields sent in the initial request cannot be
modified and any sent in the second request must match those used in the first request, or the second request will fail with
a responseCode of 64442 (REQUEST MISMATCH).
V2.00
- 134 -
GATEWAY
INTEGRATION GUIDE
inContext Use the in-context PayPal Checkout rather than the full screen Checkout
when possible.
maxAmount The expected maximum total amount of the order, including shipping and
taxes. PayPal refer to this field as MAXAMT.
reqBillingAddress Determines whether the buyer’s billing address on file with PayPal is
returned. This feature must be enabled by PayPal.
reqConfirmShipping Determines whether the buyer’s shipping address on file with PayPal
must be a confirmed address.
addrOverride Determines whether the PayPal Checkout displays the shipping address
sent using the deliveryXXXX fields and not the shipping address on file
with PayPal for this buyer. Displaying the PayPal street address on file
does not allow the buyer to edit that address.
V2.00
- 135 -
GATEWAY
INTEGRATION GUIDE
allowNote Enables the buyer to enter a note to the merchant on the PayPal page
during Checkout. The note is returned in the checkoutDetails
response field.
pageStyle Name of the Custom Payment Page Style used for the PayPal Checkout.
It is the same name as the Page Style Name used when adding styles in
the PayPal Account.
payflowColor The HTML hex colour code for the PayPal Checkout’s background colour.
By default, the colour is white (FFFFFF).
cardBorderColor The HTML hex colour code for the PayPal Checkout’s principal identifying
colour. The colour will be blended to white in a gradient fill that borders
the cart review area.
hdrImg URL for the image you want to appear at the top left of the payment page.
The image has a maximum size of 750 pixels wide by 90 pixels high.
PayPal requires that you provide an image that is stored on a secure
(https) server. If you do not specify an image, the business name
displays.
logoImg A URL to your logo image. Use a valid graphics format, such as .gif, .jpg,
or .png. Limit the image to 190 pixels wide by 60 pixels high. PayPal
crops images that are larger. PayPal places your logo image at the top of
the cart review area.
totalType Type declaration for the label to be displayed in MiniCart for UX.
brandName A label that overrides the business name in the PayPal account on the
PayPal Checkout.
V2.00
- 136 -
GATEWAY
INTEGRATION GUIDE
buyerEmailOptInEnable Enables the buyer to provide an email address on the PayPal pages to be
notified of promotions or special events.
noteToBuyer A note from the merchant to the buyer that will be displayed in the PayPal
Checkout.
paymentAction Defines how to obtain payment. This can be used to override any
captureDelay setting that can also be used to indicate a Sale or
Authorisation only.
insuranceOptionOffered Indicates whether insurance is available as an option that the buyer can
choose on the PayPal Review page.
locationType Type of merchant location. Required if the items purchased will not be
shipped, such as, BOPIS (Buy Online Pick-up In Store) or PUDO (Pick-
Up Drop-Off) transactions.
locationID Location ID specified by the merchant for BOPIS (Buy Online Pick-up In
Store) or PUDO (Pick-Up Drop-Off) transactions.
V2.00
- 137 -
GATEWAY
INTEGRATION GUIDE
sellerPayPalAccountID Unique identifier for the Merchant. For parallel payments, this field is
required and must contain the Payer Id or the email address of the
Merchant.
buyerID The unique identifier provided by eBay for this buyer. The value may or
may not be the same as the username. In the case of eBay, it is different.
buyerRegistrationDate Date when the user registered with the marketplace. In UTC/GMT format,
for example, 2013-08-24T05:38:48Z.
userSelectedFundingSourc e This element could be used to specify the preferred funding option for a
guest user. However, the landingPage Checkout option must also be
set to Billing, otherwise, it is ignored.
billingType Type of billing agreement for reference transactions. You must have
permission from PayPal to use this field.
V2.00
- 138 -
GATEWAY
INTEGRATION GUIDE
paymentType Type of PayPal payment you require for the billing agreement.
taxIDType Buyer's tax ID type. This field is required for Brazil and used for Brazil
only.
For Brazil use only: The tax ID type is BR_CPF for individuals and
BR_CNPJ for businesses.
taxID Buyer's tax ID. This field is required for Brazil and used for Brazil only.
For Brazil use only: The tax ID is 11 single-byte characters for individuals
and 14 single-byte characters for businesses
returnFMFDetails Flag to indicate whether you want the results returned by Fraud
Management Filters when doing a recurring/reference transaction.
riskSessionCorrelationID The ID of the risk session for correlation purposes when doing a
recurring/reference transaction.
1The BN code is the unique button source code provided by PayPal to its partners and added by its partners to the PayPal
buttons used by merchants to offer the PayPal Services that are enabled through Partner Product. The button source code
provides a means of identifying and tracking referred merchants' payments.
For further information on the options, refer to the PayPal Express Checkout documentation:
https://developer.paypal.com/docs/classic/api/merchant/SetExpressCheckout_API_Operation_NV
P/.
V2.00
- 139 -
GATEWAY
INTEGRATION GUIDE
Note: The shopping cart items must total to the amount specified in the transaction. If they do not,
cart items will not be sent to the PayPal Checkout.
V2.00
- 140 -
GATEWAY
INTEGRATION GUIDE
checkoutName Yes Unique name of the Checkout. For PayPal this is the
value paypal.
V2.00
- 141 -
GATEWAY
INTEGRATION GUIDE
checkoutName Yes Unique name of the Checkout. For PayPal, this is the
value paypal.
1 The response will include Customer/billing address and delivery address details if provided by the PayPal Checkout.
V2.00
- 142 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 143 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 144 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 145 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 146 -
GATEWAY
INTEGRATION GUIDE
taxID No Buyer's tax ID. This field is required for Brazil and
used for Brazil only.
V2.00
- 147 -
GATEWAY
INTEGRATION GUIDE
0 – Not accepted.
1 – Accepted.
V2.00
- 148 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 149 -
GATEWAY
INTEGRATION GUIDE
1 Only available if email option was enabled in the initial request using
checkoutOptions.buyerEmailOptInEnable option.
2 Only available if the leaving of notes was enabled in the initial request using checkoutOptions.allowNote option.
3 Permission is needed from PayPal to support this field.
4 These fields are used when no permission to use billingName.
5 This field is passed directly to PayPal and therefore the field name and value must be spelt ‘ize’ and not ‘ise’.
6 pendingReason is returned in the response only if paymentStatus is Pending.
7 This value is received directly from PayPal and so will use the ‘ize’ and not ‘ise’ spelling.
V2.00
- 150 -
GATEWAY
INTEGRATION GUIDE
21.7.1 Order
If a paymentAction with a value of ‘Order’ is sent, then PayPal will store the transaction but
delay authorising it until instructed. To instruct PayPal to authorise the transaction, a further
management request can be sent to the Gateway with an action of ‘AUTHORISE’ and the xref
of the transaction to authorise. Alternatively, the AUTHORISE command can be selected in the
Merchant Management System (MMS). The transaction will be left in the ‘received’ state.
21.7.2 Authorise
If no paymentAction is specified or a paymentAction with a value of ‘Authorize’ is sent, then
PayPal will authorise the transaction on receipt as per a standard card transaction and you can
capture it later if you used the captureDelay field. Note that the value uses the PayPal spelling
‘Authorize’, and not the British spelling ‘Authorise’.
For the first three days (by default) of the authorisation, funds are reserved. This is known as the
honour period. After the honour period, captures can still be attempted, but may be returned with
insufficient funds.
21.7.3 Sale
If a paymentAction with a value of ‘Sale’ is sent, then PayPal will immediately capture the
transaction after authorisation. The transaction will be regarded as having been settled and you
will not be able to capture it manually and it will not be sent for settlement that evening. The
transaction will be left in either the accepted or rejected terminal states depending on whether
PayPal accepted or rejected the transaction.
21.7.4 Capture
Transactions that have been authorised by PayPal and not immediately settled due to a
paymentAction of ‘Sale’ will be able to be captured as normal.
Captures are sent to PayPal immediately and the PayPal response and the transaction will be left
in either the accepted or rejected terminal state depending on whether PayPal accepted or
rejected the capture request.
There is no need to wait for the nightly settlement batch to run as with normal card transactions.
This means that it is not possible to change the amount to be captured or cancel the transaction
one a capture has been requested.
V2.00
- 151 -
GATEWAY
INTEGRATION GUIDE
Note: PayPal allows multiple captures where they sum the individual capture amounts – ie in a
different manner from the Gateway’s, where only a single capture operation can be processed.
21.7.5 Refund
PayPal transactions can be refunded in the same way as normal card transactions. However, in
the same way as capture requests, these will be sent to PayPal immediately and not batched up to
be sent as part of the nightly settlement process. This means that the transaction will be left in
either the accepted or rejected terminal state, depending on whether PayPal accepted or rejected
the refund request.
Refunds can be made for full or partial amounts, with multiple refunds allowed up to the original
authorised amount.
By default, PayPal allows a Merchant up to 60 days from the original authorised transaction date
to perform refunds.
21.7.6 Cancel
You should cancel any transactions that you do not wish to capture in order to prevent ‘pending’
transactions on the Customer’s PayPal account.
Authorisations should be cancelled when an initial authorisation was created to confirm the validity
of funds during checkout, but the goods will not ship for a significant amount of time (>29 days).
Cancelling the transaction will mean that you will have to contact the Customer for an alternative
payment method.
IPR transactions will be automatically cancelled by the Gateway and treated as referred
transactions with a responseCode of 2 and a responseMessage indicating the reason that the
transaction was put into a pending state. Unlike card referred transactions, an authorisation code
cannot be obtained from PayPal verbally and then the transaction resent.
V2.00
- 152 -
GATEWAY
INTEGRATION GUIDE
If you want to be able to make future repeat or recurring transactions, then the initial transaction
must include the billingType and billingAgreementDescription options in the
checkoutOptions so as to identify this transaction as the start of a recurring billing sequence.
This will cause the Gateway to request PayPal to set up a Billing Agreement between you and the
Customer. In this case, the PayPal Billing Agreement ID will be returned as part of the
checkoutDetails and displayed on the Merchant Management System (MMS) as part of the
payment details, so that you can easily see which PayPal transactions can be used for recurring
billing.
V2.00
- 153 -
GATEWAY
INTEGRATION GUIDE
To use Amazon Pay, you will be supplied with a separate Amazon Pay Merchant account that can
be grouped with your main Merchant account using the account mapping facility as documented in
appendix A-7. This allows transactions to be sent using your main Merchant Account and then
routed automatically to the Amazon Pay Merchant Account in the same mapping group.
It allows you to offer payment via Amazon Pay in addition to normal card payments.
Amazon Pay transactions will appear in the Merchant Management System (MMS) alongside any
card payments and can be captured, cancelled and refunded in the same way as card payments.
Amazon Pay transactions can also be used for recurring billing but require you to indicate in the
initial transaction that it will be the basis for recurring billing and a billing agreement will be entered
into between your Customer and Amazon Pay when they agree to the payment.
Amazon Pay transactions cannot be used for ad-hoc Credentials on File (COF) repeat
transactions unless a billing agreement has been set up.
For more information on how to accept Amazon Pay transactions, please contact customer
support.
Amazon Pay is supported by the Hosted and Direct Integrations. It is not supported by the
Batch Integration.
V2.00
- 154 -
GATEWAY
INTEGRATION GUIDE
• The Amazon Pay Checkout can be added as an overlay on the standard checkout to help
improve conversion rates with an easier way to pay without customers leaving your
website.
• There are no extra costs to add an Amazon Pay Merchant Account. However, you will still
be liable for the Amazon Pay transaction fees.
• The full Amazon Pay transaction information is available and returned as part of the
transaction.
• Transactions are controlled within the Merchant Management System (MMS) in the same
manner as normal card transactions.
22.2.2 Limitations
• You will need an Amazon Pay account.
• Recurring transactions are not supported unless part of a prearranged billing agreement.
• Independent refunds that are not tied to a previous sale transaction are not supported
without prior agreement.
• Transactions require a browser in order to display the Amazon Pay Checkout widgets.
V2.00
- 155 -
GATEWAY
INTEGRATION GUIDE
To customise the Amazon Pay Checkout experience, you may send various options in the
amazonPayCheckoutOptions field in your initial request.
Additional information available from Amazon Pay will be made available in the
checkoutDetails response field.
Note: Custom Hosted Payment Pages might not support the displaying of the Amazon Pay
Checkout button. If you have a custom page that doesn’t support this, then you would need to
contact support to have your Hosted Payment Page upgraded.
V2.00
- 156 -
GATEWAY
INTEGRATION GUIDE
Amazon Pay do not provide a ready built Checkout page and require you to create one on your
servers using the JavaScript widget toolkit they provide.
Amazon Pay supports the normal payment and management actions. This section explains how to
make payment requests. Management requests are performed as detailed in section 3.
To customise the Amazon Pay Checkout experience, you may send various options in the
checkoutOptions field in your initial request.
Additional information available from the Amazon Pay Checkout will be made available in the
checkoutDetails response field.
The direct integration uses two complex fields to pass data between the Amazon Pay JavaScript
widgets and the and the Gateway. The checkoutRequest field will be provided by the Gateway
and is a record whose name/value properties should be used to help initialise the widgets. The
corresponding checkoutResponse field should be returned to the Gateway and must be a
record containing name/value properties received from the widgets.
V2.00
- 157 -
GATEWAY
INTEGRATION GUIDE
If the Gateway is unable to find a suitable account, then the transaction will be aborted, and it will
respond with a responseCode of 66364 (INVALID PAYMENTMETHOD).
Otherwise, the Gateway will respond with a responseCode of 65826 (CHECKOUT REQUIRED)
and the response will include a checkoutURL field containing the URL required to load the
Amazon Pay JavaScript Widgets; and a checkoutRequest containing any data required by
those Widgets. The response will also contain a unique checkoutRef that must be echoed back
in the continuation requests.
At this point, your server must create an Amazon Pay Checkout page using their JavaScript
Widgets. Further details on how to use the Widgets are provided in the Amazon Pay guide at
https://developer.amazonpay.com/docs/classic/express-checkout/in-
context/enable_in_context_checkout/.
Note: this stage can be repeated multiple times by including the checkoutOnly field with a value
of ‘Y’ each time. To complete the transaction, the final request must not contain the
checkoutOnly field or it must not have a value of ‘Y’.
V2.00
- 158 -
GATEWAY
INTEGRATION GUIDE
checkoutResponse Yes The data received from the Amazon Pay Checkout
Widgets together with a status value.
1It is only necessary to send the checkoutRef and the checkoutResponse in the continuation request because the
checkoutRef will identify the Merchant Account and initial request. The message does not have to be signed. You can
send any of the normal request fields to modify or supplement the initial request – however, in this case the request
should be signed. The checkoutRedirectURL and checkoutOptions fields sent in the initial request cannot be
modified and any sent in the second request must match those used in the first request, or the second request will fail with
a responseCode of 64442 (REQUEST MISMATCH).
V2.00
- 159 -
GATEWAY
INTEGRATION GUIDE
shippingAddressRequired Indication that the shipping address is required, and the Address
Checkout Widget will be used.
sellerOrderID The Merchant specified identifier for this order. If not sent, then any value
in the merchantOrderRef standard integration field is used.
sellerCaptureNote A description for the capture that is displayed in emails to the buyer.
sellerBillingAgreementID The Merchant specified identifier for this billing agreement. If not sent,
then any value in the rtPolicyRef standard integration field is used.
customInformation Any additional information that you want to include with this order
reference
shippingAddressRequired Indication that the shipping address is required, and the Address
Checkout Widget will be used.
For further information on the options refer to the Amazon Pay API Reference Guide:
https://pay.amazon.com/us/developer/documentation/apireference/201751630
V2.00
- 160 -
GATEWAY
INTEGRATION GUIDE
checkoutName Yes Unique name of the Checkout. For Amazon Pay this
is the value amazonpay.
V2.00
- 161 -
GATEWAY
INTEGRATION GUIDE
checkoutName Yes Unique name of the Checkout. For Amazon Pay this
is the value amazonpay.
1The response will include Customer/billing address and delivery address details if provided by the Amazon Pay
Checkout.
V2.00
- 162 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 163 -
GATEWAY
INTEGRATION GUIDE
22.6.1 Capture
Captures made by the Direct Integration or Merchant Management System (MMS) are sent to
Amazon Pay immediately the transaction will be left in either the accepted or rejected terminal
state depending on whether Amazon Pay accepted or rejected the capture request. Unlike card
payments captures do not flag the transaction to be included in the nightly settlement batch and
therefore, when done they cannot be redone. This means that it is not possible to change the
amount to be captured or cancel the transaction when a capture has been requested.
Captures that are not explicitly performed such as normal transactions or those with a
captureDelay are still done as part of the nightly settlement batch.
Transactions that are not captured within 3 days will be placed in a pending state in the Amazon
Pay system which is reflected as the tendered state in the Gateway and will show on the
Merchant Management System as being settled.
Refunds can be made for full or partial amounts, with multiple refunds allowed up to the original
authorised amount.
V2.00
- 164 -
GATEWAY
INTEGRATION GUIDE
If you want to be able to make future repeat or recurring transactions, then the initial transaction
must include an rtAgreementType of recurring or instalment. Alternatively, the
billingAgreementRequired option can be included in the checkoutOptions so as to
identify this transaction as the start of a recurring billing sequence.
This will cause the Gateway to request Amazon Pay setup a Billing Agreement between you and
the Customer. In this case the Amazon Pay Billing Consent Widget must be used in the Checkout
and the billingAgreementID it creates sent in the checkoutResponse data in the
continuation request. Any billing agreement id will be displayed on the Merchant Management
System (MMS) as part of the payment details so that you can easily see which Amazon Pay
transactions can be used for recurring billing.
V2.00
- 165 -
GATEWAY
INTEGRATION GUIDE
23 PPRO Transactions
23.1 Background
PPRO is an additional payment method that is available to all Merchants using the Gateway that
have an PPRO account.
To use PPRO you will be supplied with a separate PPRO Merchant account that can be grouped
with your main Merchant Account using the account mapping facility as documented in appendix
A-7. This allows transactions to be sent using your main Merchant Account and then routed
automatically to the PPRO Merchant Account in the same mapping group.
PPRO is an Acquirer that offers many Alternative Payment Methods (APM), that you can then
offer to your Customers.
E-wallets, SMS payments and PSP services are some of the many payment methods PPRO
support (eg Alipay, EasyPay, Bancontact). This could allow a business to facilitate overseas
transactions or alternative payment methods using a different payment method suitable for that
country or business plan.
All transactions created with this payment method will appear in the Merchant Management
System (MMS) together with the payment method that was used to process the transaction.
PPRO transactions cannot be used for ad-hoc Credential on File (COF) repeat transactions or for
recurring billing.
For more information on how to accept PPRO transactions please contact customer support.
PPRO is supported by the Hosted and Direct Integrations. It is not supported by the Batch
Integration.
V2.00
- 166 -
GATEWAY
INTEGRATION GUIDE
• Transactions are controlled within the Merchant Management System (MMS) in the same
manner as normal card transactions.
23.2.2 Limitations
• You will need a PPRO account.
• Payment authorisation is not always instantaneous and may require additional ‘QUERY’
requests.
• An alternative payment method may only support one or a limited set of currencies or
countries.
V2.00
- 167 -
GATEWAY
INTEGRATION GUIDE
To customise the alternative payment methods checkout experience, you may send various
options in the pproCheckoutOptions field in your initial request.
Additional information available from PPRO will be made available in the checkoutDetails
response field.
Note: Custom Hosted Payment Pages might not support the displaying of the Alternative Payment
Methods. If you have a custom page that doesn’t support this, then you would need to contact
support to have your Hosted Payment Page upgraded.
V2.00
- 168 -
GATEWAY
INTEGRATION GUIDE
PPRO supports only supports the SALE, REFUND_SALE actions. This section explains how to
make payment requests. Management requests are performed as detailed in section 3.
To customise the alternative payment method’s Checkout experience, you may send various
options in the checkoutOptions field in your initial request.
Additional information available from the alternative payment method’s Checkout will be made
available in the checkoutDetails response field.
The direct integration uses two complex fields to pass data between PPRO and the Gateway. The
checkoutRequest field will be provided by the Gateway and is a record whose name/value
properties represent the data provided in the checkoutURL and is provided for information
purposes only. The corresponding checkoutResponse field should be returned to the Gateway
and must be a record containing name/value properties received from the Checkout when it
redirects the Cardholder’s browser back to the URL provided using the checkoutRedirectURL
on completion.
When the Gateway receives these fields, assuming there are no other errors with the request, it
will attempt to find a suitable PPRO Merchant Account in the current account mapping group
(Refer to appendix A-7).
If the Gateway is unable to find a suitable account, then the transaction will be aborted, and it will
respond with a responseCode of 66364 (INVALID PAYMENTMETHOD).
Otherwise, the Gateway will respond with a responseCode of 65826 (CHECKOUT REQUIRED)
and included in the response will be a checkoutURL field containing the URL that the buyer’s
browser should be redirected to in order to complete the payment. The response will also contain
a unique checkoutRef which must be echoed back in the continuation requests.
V2.00
- 169 -
GATEWAY
INTEGRATION GUIDE
For example, most European services may require the nationalid and consumerref fields.
Recurring transactions will require the use of iban (optionally sequencetype) and in follow-up
payments; mandatereference, mandatesignaturedate, and sequencetype.
These fields are documented in your PPRO integration guide as SPECIN fields.
Customer support will be able to guide you on any mandatory options as you will find the
transaction will fail with a responseCode of 65550 (PROCESSOR_ERROR - Invalid request
data) if any are missing.
For example, to use the alternative payment method AstroPay Card that has a tag name of
“astropaycard” (all lowercase); the resulting payment method code would be “ppro.astropaycard”.
This allows the Gateway to know that you’re attempting to use AstroPay Card using the PPRO
payment method.
The table below is a guide to the tag names available. This list is fluid as PPRO add and remove
methods.
If you know of a payment method that is not on this list or the payment method cannot be used;
please contact customer support for advice.
alipay AliPay
ambank AmBank
V2.00
- 170 -
GATEWAY
INTEGRATION GUIDE
argencard Argencard
aura Aura
baloto Baloto
banamex Banamex
bancomer Bancomer
bcmc Bancontact
bitpay Bitpay
bradesco Bradesco
cabal Cabal
carulla Carulla
cencosud Cencosud
cmr CMR
davivienda Davivienda
dragonpay Dragonpay
easypay EasyPay
efecty Efecty
V2.00
- 171 -
GATEWAY
INTEGRATION GUIDE
elo Elo
enets eNETS
entercash Entercash
eps EPS
giropay Giropay
hipercard Hipercard
ideal iDEAL
itau Itau
magna Magna
maxima Maxima
maybanktwou Maybank2u
multibanco Multibanco
mybank MyBank
naranja Naranja
narvesen Narvesen
nativa Nativa
oxxo OXXO
p24 Przelewy24
V2.00
- 172 -
GATEWAY
INTEGRATION GUIDE
paypost PayPost
paysbuy Paysbuy
paysera Paysera
payu PayU
poli OLI
presto Presto
pse PSE
pugglepay Pugglepay
qiwi QIWI
rapipago Rapipago
redpagos Redpagos
safetypay SafetyPay
santander Santander
singpost SingPost
skrill Skrill
surtimax Surtimax
trustly Trustly
trustpay TrustPay
unionpay UnionPay
V2.00
- 173 -
GATEWAY
INTEGRATION GUIDE
webpay Webpay
V2.00
- 174 -
GATEWAY
INTEGRATION GUIDE
4 Whilst the Gateway does not see this field as mandatory, PPRO may have payment methods that require additional
configuration using checkout options.
5 Hosted Integration Only
V2.00
- 175 -
GATEWAY
INTEGRATION GUIDE
siteid Unique site identifier. Required for clients serving multiple points of sale and
forwarded onwards whilst using the qiwi payment method.
mandatereference Mandate reference as returned on the first transaction in the sequence (found
from mandatereference in checkoutDetails)
bic Valid BIC (8 or 11 alphanumeric letters) – optionally supplied to skip the bank
selection page (by using the bank referenced by BIC as supplied)
clientip Optional IP address of the consumer during checkout using Trustly (127.0.0.1
is not allowed!)
1This information is supplied to PPRO by default using the following fields: customerAddress, customerPostcode,
customerTown, customerEmail, customerPhone, customerMobile, receiverDateOfBirth, statementNarrative1.
V2.00
- 176 -
GATEWAY
INTEGRATION GUIDE
checkoutRedirectURL Yes The URL to redirect the Customer to, to start the
checkout process.
1Not all payment methods give an immediate payment status. This will require a further QUERY to the Gateway to see
whether this value has changed to a status of ‘tendered’.
V2.00
- 177 -
GATEWAY
INTEGRATION GUIDE
Notifications from PPRO regarding the payment status, seconds, minutes or hours after the
checkout will automatically update the transaction status.
V2.00
- 178 -
GATEWAY
INTEGRATION GUIDE
PBBA, formerly known as Zapp, is an innovative, secure, and fully digital payment option in the
UK, built and operated by VocaLink, a Mastercard company. It allows your Customers to pay, in
real time, using the banking app on their phone. It's designed to make online checkout easier,
whilst using all the security of their bank. Payments work through secure digital tokens, meaning
your Customers never reveal any of their financial details when they are shopping.
To use PBBA you will be supplied with a separate PBBA Merchant account that can be grouped
with your main Merchant Account using the account mapping facility as documented in appendix
A-7. This allows transactions to be sent using your main Merchant Account and then routed
automatically to the PBBA Merchant Account in the same mapping group.
All transactions created with this payment method will appear in the Merchant Management
System (MMS) together with the payment method that was used to process the transaction.
PBBA transactions cannot be used for ad-hoc Credentials on File (COF) repeat transactions or for
recurring billing.
For more information on how to accept PBBA transactions please contact customer support.
Pay by Bank app (PBBA) transactions are only available with an OBN Global merchant account.
This payment method is pre-release and these integration details maybe subject to change before
general release.
PBBA is supported by the Hosted and Direct Integrations. It is not supported by the Batch
Integration.
V2.00
- 179 -
GATEWAY
INTEGRATION GUIDE
• Transactions are controlled within the Merchant Management System (MMS) in the same
manner as normal card transactions.
24.2.2 Limitations
• You will need a PBBA account and OBN Acquiring account.
• Transactions require a browser or mobile device in order to display the PBBA Checkout.
• Your Customer will need a mobile device in order to display their Banking app.
• Payment authorisation is not instantaneous and will require additional ‘QUERY’ requests.
• Transactions require a browser or mobile device in order to display the PBBA Checkout.
V2.00
- 180 -
GATEWAY
INTEGRATION GUIDE
Additional information available about the PBBA transaction will be made available in the
checkoutDetails response field.
Note: Custom Hosted Payment Pages might not support the displaying of the Pay by Bank App
payment button. If you have a custom page that doesn’t support this, then you would need to
contact support to have your Hosted Payment Page upgraded.
V2.00
- 181 -
GATEWAY
INTEGRATION GUIDE
PBBA supports only supports the SALE, REFUND_SALE, CANCEL and CAPTURE actions. This
section explains how to make payment requests. Management requests are performed as detailed
in section 3.
If the Gateway is unable to find a suitable account, then the transaction will be aborted, and it will
respond with a responseCode of 66364 (INVALID PAYMENTMETHOD).
Otherwise, the Gateway will initiate the PBBA transaction and respond with a responseCode of 0
(SUCCESS) and included in the response will be a checkoutDetails field containing the
Basket Reference Number (BRN) that should be displayed to the Customer.
Please note that the payment has not completed until the Customer enters the BRN into their
mobile banking application and confirms the payment. The response will contain a state of
received until the Gateway has received confirmation from the banking network that the payment
has been confirmed by the Customer.
To determine when payment has completed you may periodically poll the Gateway using a
QUERY request to check the state of the transaction. For more information on the QUERY
request, please refer to section 1.9.8
1 The current PBBA Merchant Integration Libraries are available from Mastercard.
V2.00
- 182 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 183 -
GATEWAY
INTEGRATION GUIDE
device.type Consumer device type. This field is mandatory and has no default value.
device.os Consumer device operating system. This field is mandatory and has no default
value.
browser.userAgent Content of HTTP User-Agent header received from the Consumer’s device.
Maximum 127 characters.
browser.timeZone Time zone offset in minutes between UTC and the Consumer’s device. The
offset is positive if the local time zone is behind UTC and negative if it is ahead.
browser.screenResolution Screen resolution of the Consumer’s device. Formatted as the height and width
separated by a ‘x’. The height and width must be between 1 and 9999 pixels.
The category.name format of the sub-field name indicates that option’s value is a record called
category containing a sub-field called name.
V2.00
- 184 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 185 -
GATEWAY
INTEGRATION GUIDE
The code must be in uppercase and must appear as a separate word anywhere in the field’s
value.
For example, if refunding due to the purchased item being out of stock you could set the value to
just “MERCHANTOUTOFSTOCK” or to a more complete description such as “Refund: Green polo
shirt, XXL (MERCHANTOUTOFSTOCK)”.
This also applies to refunds made by the Merchant Management System (MMS) where the reason
code must be entered when prompted for the reason for the refund.
Only the refund code is sent to the PBBA system, any other text is stored by the Gateway for your
benefit and viewable in the Merchant Management System (MMS).
V2.00
- 186 -
GATEWAY
INTEGRATION GUIDE
25 SecurePlus Transactions
25.1 Background
SecurePlus is available if you have a Planet Merchant Account. It is a secure e-commerce
payment solution designed to allow you to accept China UnionPay debit cards via the Planet
Acquirer, with a reduced the risk of fraudulent transactions while providing a friction-free payment
process for your Customers. SecurePlus divides the online payment process into separate
authentication and authorisation transaction flows that authenticates the cardholder’s identity
before you submit the authorisation request.
To use SecurePlus you will be supplied with a separate Planet Merchant Account that can be
grouped with your main Merchant Account using the account mapping facility as documented in
appendix A-7. This allows transactions to be sent using your main Merchant Account and then
routed automatically to the Planet Merchant Account in the same mapping group.
When UnionPay debit cards are issued, the Cardholder must register their mobile number with the
Issuer. The SMS code authentication works at the time of checkout by submitting the payment
details to UnionPay together with the Cardholder’s mobile number. The Issuer verifies the card
and registered mobile number and sends an SMS message to the to the Cardholder’s mobile
phone containing a unique 6-digit code. The Cardholder then enters this code into an
authentication dialog provided by the Gateway so that it can be sent to UnionPay for verification.
If approved, the final financial transaction is submitted.
The authentication process is only required for debit cards. Fraud liability is shifted from the
Merchant to the Issuer when a transaction is successfully authenticated. To accommodate the
use of cards stored in secure online wallet, the card authentication has some built-in flexibility
when other compensating controls are employed.
SecurePlus transactions will appear in the Merchant Management System (MMS) alongside any
card payments and can be captured, cancelled and refunded in the same way as card payments.
SecurePlus transactions can also be used for recurring billing with the SMS authentication not
been required on recurring transactions as long as the initial transaction was successfully SMS
authenticated.
.
For more information on how to accept SecurePlus transactions, please contact customer support.
SecurePlus is supported by the Hosted and Direct Integrations. It is not supported by the
Batch Integration apart from recurring billing.
V2.00
- 187 -
GATEWAY
INTEGRATION GUIDE
• Provides your customers the flexibility of paying using their UnionPay debit card when this
is more suitable to them than using other payment methods.
• Can be implemented with little or no extra integration work if you already support 3-D
Secure transactions.
• There are no extra Gateway costs to use SecurePlus. Your Acquirer may charge to add this
onto your business account; however, you may also find that your transaction charges are
lower as a result of using 3-D Secure.
25.2.2 Limitations
• You will need a Planet Acquiring, however, such an account can also be used to process all
your other card transactions.
• Only UnionPay debit cards are supported, however, UnionPay credit cards can be accepted
without the need for SecurePlus.
• You must currently provide the Gateway with the Cardholder’s mobile phone number at the
time of the transaction. The Hosted Payment Page will prompt the Cardholder for this
information if it detects that a UnionPay debit card is being supplied.
• The Cardholder must have access to their registered mobile phone during the payment
process.
• Transactions require a browser in order to display the Customer SMS code entry dialog.
V2.00
- 188 -
GATEWAY
INTEGRATION GUIDE
The SecurePlus authentication page is designed and controlled by the Gateway, but you can
change the Merchant name and website address that is displayed on the form by sending the
merchantName and/or merchantWebsite request fields.
Any merchantWebsite must be a fully qualified URL containing at least the scheme and host
components.
Note: Custom Hosted Payment Pages may not support the collection of the Cardholder’s mobile
number or the displaying of the SecurePlus authentication page. If you have a custom page which
doesn’t support this, then you would need to contact support to have your Hosted Payment Page
upgraded.
V2.00
- 189 -
GATEWAY
INTEGRATION GUIDE
In addition, the Cardholder’s mobile phone number must be provided in the transaction request.
V2.00
- 190 -
GATEWAY
INTEGRATION GUIDE
You can use these wallets with any Merchant Account that has been configured to accept them.
For more information on how to accept payment tokens, please contact customer support.
Digital Wallets are currently supported by the Direct Integration only. They are not
supported by the Hosted or Batch Integration.
Digital wallet support is not available with all Acquirers and must be enabled on your Merchant
Account before they can be used. Please contact support to find out whether your Acquirer supports
the and which can be enabled on your Merchant Account.
V2.00
- 191 -
GATEWAY
INTEGRATION GUIDE
• Customers can select from previously stored payment details, making the checkout process
more streamlined, resulting in fewer abandoned carts and thus increasing sales.
• Compatible with existing card base fraud solutions such as Address Verification Service
(AVS), 3-D Secure and third-party fraud providers.
• There are no extra costs to add these payment methods to your Gateway account.
• The transactions are controlled within the Merchant Management System (MMS) in the
same manner as normal card transactions.
26.2.2 Limitations
• Your Customer will need a digital wallet enabled device with some stored card details in
order to make full use of this payment method.
• The device needs to be integrated with the gateway using third-party provided software.
V2.00
- 192 -
GATEWAY
INTEGRATION GUIDE
26.3 Configuration
The Merchant Account being used for the payments must be configured with your Digital Wallet
credentials so that the Gateway can decrypt the payment token.
To configure an Apple Pay payment processing certificate you must have enrolled in the Apple
Developer Program and created a unique Apple Pay merchant identifier.
The payment processing certificate is associated with your merchant identifier and used to encrypt
payment information. The certificate expires every 25 months. If the certificate is revoked, you can
recreate it.
You would normally use the Merchant Management System (MMS) to configure your payment
processing certificate by following the steps outlined below:
1. Open the Apple Developer Certificates, Identifiers & Profiles webpage and select
'Identifiers' from the sidebar.
2. Under 'Identifiers', select 'Merchant IDs' using the filter in the top-right.
3. On the right, select your merchant identifier.
4. Under 'Apple Pay Payment Processing Certificate', click 'Create Certificate'.
5. Download our certificate signing request (CSR) from the MMS and save to a file.
6. Click 'Choose File' and select the CSR you just downloaded.
7. Click 'Continue'.
8. Click 'Download' to download the payment processing certificate and save to a file.
9. Upload the payment processing certificate to the MMS.
V2.00
- 193 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 194 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 195 -
GATEWAY
INTEGRATION GUIDE
Google Pay (Web) payment tokens contain the Cardholder’s original card number (FPAN) and
expiry date. This means that the card mask and expiry date will be those of the original card.
The Gateway and Acquirer will not perform CVV checks with these payment tokens effectively
disabling CVV checks for the transaction disregarding your preferences.
FPAN based tokens can passed to the Gateway’s 3-D Secure processing and undergo the normal
authentication journey as a manually entered card number.
- 196 -
GATEWAY
INTEGRATION GUIDE
Response codes are grouped; however, the groupings are for informational purposes only and not
all codes in a group are used and some codes may exist for completeness or future use.
The Gateway uses a set of standard response codes to indicate the status of an authorisation
request to the Acquirer. These response codes are based on the 2-character ISO 8583 response
codes.
The full set of ISO 8583 codes used are given in the table below, however not all are applicable to
transactions currently supported by the Gateway and therefore not used and documented for
reference purposes only.
Some ISO-8583 codes are not numeric and therefore to ensure all Gateway response codes are
numeric these codes are mapped to an equivalent numeric code greater than 99. This equivalent
numeric code is shown in the table below along with the original 2 letter code in brackets.
Not all ISO-8583 codes are applicable to the types of transactions currently available via the
Gateway and therefore unapplicable codes, although documented, may not currently be returned.
If the authorising Acquirer does not return a suitable ISO 8583 code, then the Gateway will attempt
to map the Acquirers response to a suitable code.
The original Acquirer authorisation response code and response message will always be returned
in the acquirerResponseCode and acquirerResponseMessage fields as detailed in section
18.
The original Acquirer authorisation response code may not be numeric and information on these
codes will need to be requested from the Acquirer.
V2.00
- 197 -
GATEWAY
INTEGRATION GUIDE
Code Description
0 Successful approval/completion
4 Pickup card
5 Do not honor
6 Error
9 Request in progress
11 Approved VIP
12 Invalid transaction
13 Invalid amount (currency conversion field overflow), or amount exceeds maximum for card program
15 No such issuer
17 Customer cancellation
18 Customer dispute
19 Re-enter transaction
22 Suspected malfunction
23 Unacceptable transaction
25 Reference number cannot be found. Unable to locate record in file, or account number is missing
from the inquiry
V2.00
- 198 -
GATEWAY
INTEGRATION GUIDE
Code Description
30 Format error
32 Complete partially
39 No credit account
42 No universal account
44 No investment account
45 Account closed
46 Identification required
48 No from account
49 No to account
50 No account
51 Insufficient funds
52 No checking account
V2.00
- 199 -
GATEWAY
INTEGRATION GUIDE
Code Description
53 No savings account
54 Expired card
55 Incorrect PIN
56 Unknown card
59 Suspected fraud
60 Contact acquirer
63 Security violation
66 Contact acquirer
68 Time out
77 Previous message located for a repeat or reversal, but repeat or reversal data are inconsistent with
original message
78 Blocked, first used. The transaction is from a new cardholder, and the card has not been unblocked
79 Already reversed
V2.00
- 200 -
GATEWAY
INTEGRATION GUIDE
Code Description
80 Visa transactions: credit issuer unavailable. Private label and check acceptance: Invalid date
81 PIN cryptographic error found (error found by VIC security module during PIN decryption)
85 No reason to decline a request for account number verification, address verification, CVV2
verification, or a credit voucher or merchandise return
88 Unable to authorise
89 Ineligible to receive
90 Cut-off in progress
91 Issuer unavailable or switch inoperative (STIP not applicable or available for this transaction)
94 Duplicate transaction
95 Reconcile error
96 System malfunction
97 Security Breach
497 (B1) Surcharge amount not permitted on Visa cards (U.S. acquirers only)
V2.00
- 201 -
GATEWAY
INTEGRATION GUIDE
Code Description
V2.00
- 202 -
GATEWAY
INTEGRATION GUIDE
The Gateway uses a set of enhanced response codes to indicate if there is an issue with the
transaction which prevented any authorisation response being received from the Acquirer. These
response codes start at 65536.
The responses are grouped into categories and the codes in the ‘missing’ and ‘invalid’ field
categories are designed so that that invalid field code is exactly 256 greater than the
corresponding missing field code. For example, the code of a missing action field is 66055 and
the corresponding code for an invalid action field is 66311 (66055 + 256).
Code Description
65538 Reserved for future use. Contact customer support if this error occurs.
65541 Action not allowed: action is not supported by the Acquirer or allowed for the transaction.
65542 Request Mismatch: fields sent while completing a request do not match initially requested values.
Usually due to sending different card details to those used to authorise the transaction when
completing a 3-D Secure transaction or performing a REFUND_SALE transaction.
65543 Request Ambiguous: request could be misinterpreted due to inclusion of mutually exclusive fields.
65547 Request Ambiguous, both taxValue and discountValue provided when should be one only.
V2.00
- 203 -
GATEWAY
INTEGRATION GUIDE
Code Description
65556 AVS/CV2 Checks are not supported for this card (or Acquirer).
65558 Primary IP blocked: Request is not from one of the primary IP addresses configured for this Merchant
Account.
65559 Secondary IP blocked: Request is not from one of the secondary IP addresses configured for this
Merchant Account.
65560 Reserved for future use. Contact customer support if this error occurs.
65561 Unsupported Card Type: Request is for a card type that is not supported on this Merchant Account.
65562 Unsupported Authorisation: External authorisation code authorisationCode has been supplied and
this is not supported for the transaction or by the Acquirer.
65563 Request not supported: The Gateway or Acquirer does not support the request.
65564 Request expired: The request cannot be completed as the information is too old.
65566 Test Card Used: A test card was used on a live Merchant Account.
65567 Unsupported card issuing country: Request is for a card issuing country that is not supported on this
Merchant Account.
65574 Reserved for future use. Contact customer support if this error occurs.
Code Description
- 204 -
GATEWAY
INTEGRATION GUIDE
Code Description
65794 3-D Secure processing is required. 3-D Secure ACS challenge must be displayed.
65796 3-D Secure processing is unavailable. Merchant account or Acquirer doesn’t support 3-D Secure.
65803 3-D Secure authentication results do not meet the Merchant’s preferences.
Code Description
Code Description
V2.00
- 205 -
GATEWAY
INTEGRATION GUIDE
Code Description
Missing Request Field Error Codes: 66048 – 66303 and 66560 – 66815
Code Description
66051 Reserved for internal use. Contact customer support if this error occurs.
66052 Reserved for internal use. Contact customer support if this error occurs.
66053 Reserved for internal use. Contact customer support if this error occurs.
66054 Reserved for internal use. Contact customer support if this error occurs.
V2.00
- 206 -
GATEWAY
INTEGRATION GUIDE
Missing Request Field Error Codes: 66048 – 66303 and 66560 – 66815
Code Description
66077 Reserved for internal use. Contact customer support if this error occurs.
V2.00
- 207 -
GATEWAY
INTEGRATION GUIDE
Missing Request Field Error Codes: 66048 – 66303 and 66560 – 66815
Code Description
66109 Reserved for internal use. Contact customer support if this error occurs.
- 208 -
GATEWAY
INTEGRATION GUIDE
Missing Request Field Error Codes: 66048 – 66303 and 66560 – 66815
Code Description
66124 Reserved for future use. Contact customer support if this error occurs.
66126 Reserved for future use. Contact customer support if this error occurs.
V2.00
- 209 -
GATEWAY
INTEGRATION GUIDE
Missing Request Field Error Codes: 66048 – 66303 and 66560 – 66815
Code Description
66157 Reserved for future use. Contact customer support if this error occurs.
66162 Reserved for future use. Contact customer support if this error occurs.
66163 Reserved for future use. Contact customer support if this error occurs.
V2.00
- 210 -
GATEWAY
INTEGRATION GUIDE
Missing Request Field Error Codes: 66048 – 66303 and 66560 – 66815
Code Description
66186 Reserved for future use. Contact customer support if this error occurs.
66187 Reserved for future use. Contact customer support if this error occurs.
66188 Reserved for future use. Contact customer support if this error occurs.
66189 Reserved for future use. Contact customer support if this error occurs.
66190 Reserved for future use. Contact customer support if this error occurs.
66191 Reserved for future use. Contact customer support if this error occurs
V2.00
- 211 -
GATEWAY
INTEGRATION GUIDE
Missing Request Field Error Codes: 66048 – 66303 and 66560 – 66815
Code Description
66211 Reserved for future use. Contact customer support if this error occurs.
- 212 -
GATEWAY
INTEGRATION GUIDE
Missing Request Field Error Codes: 66048 – 66303 and 66560 – 66815
Code Description
- 213 -
GATEWAY
INTEGRATION GUIDE
Missing Request Field Error Codes: 66048 – 66303 and 66560 – 66815
Code Description
- 214 -
GATEWAY
INTEGRATION GUIDE
Missing Request Field Error Codes: 66048 – 66303 and 66560 – 66815
Code Description
V2.00
- 215 -
GATEWAY
INTEGRATION GUIDE
Invalid Request Field Error Codes: 66304 – 66559 and 66816 – 67071
Code Description
66307 Reserved for internal use. Contact customer support if this error occurs.
66308 Reserved for internal use. Contact customer support if this error occurs.
66309 Reserved for internal use. Contact customer support if this error occurs.
66310 Reserved for internal use. Contact customer support if this error occurs.
V2.00
- 216 -
GATEWAY
INTEGRATION GUIDE
Invalid Request Field Error Codes: 66304 – 66559 and 66816 – 67071
Code Description
66333 Reserved for internal use. Contact customer support if this error occurs.
V2.00
- 217 -
GATEWAY
INTEGRATION GUIDE
Invalid Request Field Error Codes: 66304 – 66559 and 66816 – 67071
Code Description
66365 Reserved for internal use. Contact customer support if this error occurs.
66380 Reserved for internal use. Contact customer support if this error occurs.
66382 Reserved for internal use. Contact customer support if this error occurs
V2.00
- 218 -
GATEWAY
INTEGRATION GUIDE
Invalid Request Field Error Codes: 66304 – 66559 and 66816 – 67071
Code Description
- 219 -
GATEWAY
INTEGRATION GUIDE
Invalid Request Field Error Codes: 66304 – 66559 and 66816 – 67071
Code Description
66413 Reserved for future use. Contact customer support if this error occurs
66418 Invalid line items count, either too few or too many for processor.
66419 Invalid line items sequence, either not sequential or not 0 to 99.
V2.00
- 220 -
GATEWAY
INTEGRATION GUIDE
Invalid Request Field Error Codes: 66304 – 66559 and 66816 – 67071
Code Description
66442 Reserved for future use. Contact customer support if this error occurs.
66443 Reserved for future use. Contact customer support if this error occurs.
66444 Reserved for future use. Contact customer support if this error occurs.
66445 Reserved for future use. Contact customer support if this error occurs.
66446 Reserved for future use. Contact customer support if this error occurs.
66447 Reserved for future use. Contact customer support if this error occurs
V2.00
- 221 -
GATEWAY
INTEGRATION GUIDE
Invalid Request Field Error Codes: 66304 – 66559 and 66816 – 67071
Code Description
66467 Reserved for future use. Contact customer support if this error occurs.
- 222 -
GATEWAY
INTEGRATION GUIDE
Invalid Request Field Error Codes: 66304 – 66559 and 66816 – 67071
Code Description
- 223 -
GATEWAY
INTEGRATION GUIDE
Invalid Request Field Error Codes: 66304 – 66559 and 66816 – 67071
Code Description
- 224 -
GATEWAY
INTEGRATION GUIDE
Invalid Request Field Error Codes: 66304 – 66559 and 66816 – 67071
Code Description
V2.00
- 225 -
GATEWAY
INTEGRATION GUIDE
Response Description
SECURITY CHECKS NOT SUPPORTED Card scheme does not support checks
V2.00
- 226 -
GATEWAY
INTEGRATION GUIDE
The AVS/CV2 Response Code avscv2ResponseCode is made up of six characters and is sent
back in the raw form that is received from the Acquiring bank. The first 4 characters can be
decoded as below, the remaining 2 characters are currently reserved for future use:
2 CV2 matched.
8 Reserved
2 Postcode matched.
0 No Additional Information
V2.00
- 227 -
GATEWAY
INTEGRATION GUIDE
The field’s values would normally be populated by the Gateway’s 3DS v1 Merchant Plugin
Interface (MPI) or 3DS v2 3DS Server component1, however you may choose to use your own
MPI/3DS Server component and provide the values, as described in section 5.4.6.
The threeDSEnrolled field indicates if the card is enrolled in the 3-D Secure program.
For 3DS v1 the value is requested from the Directory Server for every transaction using a Verify
Enrolment Request/Response (VEReq/VERes) message.
For 3DS v2 the value is determined if the card number is within one of the enrolled ranges
downloaded daily from the Directory Server using a Preparation Request/Response (PReq/PRes)
message.
Y – Enrolled. The card is enrolled in the 3-D Secure program and the payer is eligible for authentication
processing.
N - Not Enrolled. The checked card is eligible for the 3-D Secure (it is within the card association’s range of
accepted cards) but the card issuing bank does not participate in the 3-D Secure program. If the Cardholder
later disputes the purchase, the issuer may not submit a chargeback to you.
U - Unable To Verify Enrolment. The card associations were unable to verify whether the Cardholder is registered.
As the card is ineligible for 3-D Secure, you can choose to accept the card nonetheless and precede the
purchase as non-authenticated and submits authorisation with ECI 07. You and the Acquirer retain liability if
the Cardholder later disputes making the purchase (3DS v1 only).
E - Error Verifying Enrolment. The Gateway encountered an error. This card is flagged as 3-D Secure ineligible.
The card can be accepted for payment, yet you may not claim a liability shift on this transaction in case of a
dispute with the Cardholder (3DS v1 only).
1 The 3DS Server is the Gateway/Merchant component that provides the interface with the 3DS Directory Server.
V2.00
- 228 -
GATEWAY
INTEGRATION GUIDE
The threeDSAuthenticated field indicates if the cardholder has been authenticated by the 3-D
Secure program.
For 3DS v1 the value is provided by the Authentication Control Server after a Cardholder
challenge in the Payer Authentication Response (PARes) message.
For 3DS v2 the value is provided by the Directory Server either on requesting authentication in the
Authentication Response (ARes) message, in the case of a frictionless flow, or after a Cardholder
challenge in the Result Request (RReq) message, in the case of a challenge flow.
Y - Authentication Successful. The Issuer has authenticated the Cardholder by verifying the identity information or
password. A CAVV and an ECI of 5 is returned. The card is accepted for payment.
A - Attempted Authentication. A proof of authentication attempt was generated. The Cardholder is not participating,
but the attempt to authenticate was recorded. The card should be accepted for payment and authentication
information passed to authorisation processing.
N - Not Authenticated. The Cardholder did not complete authentication and the card should not be accepted for
payment.
R – Rejected By Issuer. The Issuer rejected the transaction and must not be accepted for payment (3DS v2 only).
U - Unable To Authenticate. The authentication was not completed due to technical or another problem. A
transmission error prevented authentication from completing. The card should be accepted for payment, but no
authentication data will be passed on to authorisation processing and no liability shift will occur.
E - Error Checking Authentication. The Gateway encountered an error. The card should be accepted for payment,
but no authentication information will be passed to authorisation processing and no liability shift will occur.
The threeDSXID field provides a unique value to identify the transaction through the 3-D Secure
system.
For 3DS v1 the value is referred to as the Transaction Identifier or XID and is a 28-character Base-
64 encode identifier.
For 3DS v2 the value is referred to as the 3DS Server Transaction ID and is a 36-character
universally unique identifier (UUID) as defined in IETF RFC 4122.
V2.00
- 229 -
GATEWAY
INTEGRATION GUIDE
The threeDSECI field indicates the security status of the transaction after the Cardholder has
been authenticated or attempted authentication.
For 3DS v1 the value is provided by the Authentication Control Server after a Cardholder
challenge in the Payer Authentication Response (PARes) message.
For 3DS v2 the value is provided by the Directory Server either on requesting authentication in the
Authentication Response (ARes) message, in the case of a frictionless flow, or after a Cardholder
challenge in the Result Request (RReq) message, in the case of a challenge flow.
The value is always present if the threeDSAuthenticated field has a value of Y (successful
authentication), or A (attempted authentication) but can be present at other times.
05/02 - Both cardholder and card issuing bank are 3DS enabled. 3DS card authentication is
successful.
06/01 - Either cardholder or card issuing bank is not 3DS enrolled. 3DS card authentication is
unsuccessful, in sample situations as:
1. 3DS cardholder not enrolled.
2. Card issuing bank is not 3DS ready.
07/00 - Authentication is unsuccessful or not attempted. The card is either a non-3DS card or
card issuing bank does not handle it as a 3DS transaction.
1 The values are show as pairs, the first value is for Visa and other card schemes and the second for Mastercard only.
The threeDSCAVV field provides proof that the Cardholder has been authenticated or attempted
authentication.
For 3DS v1 the value is provided by the Authentication Control Server after a Cardholder
challenge in the Payer Authentication Response (PARes) message.
For 3DS v2 the value is provided by the Directory Server either on requesting authentication in the
Authentication Response (ARes) message, in the case of a frictionless flow, or after a Cardholder
challenge in the Result Request (RReq) message, in the case of a challenge flow.
The field will contain a 28-character Base-64 encoded value (32-characters for Mastercard).
V2.00
- 230 -
GATEWAY
INTEGRATION GUIDE
However, there may be times when you may wish to gain more control over the Enrolment and
Authentication process. The following field allows the request processing to stop after the 3-D
Secure enrolment check or authentication check and return;
If this flag is used when 3-D Secure is not enabled on the account or after the 3-D Secure process
has been completed for the request (ie when the authentication step has completed), then passing
the flag will cause the transaction to abort with a responseCode of 65795 (3DS PROCESSING
NOT REQUIRED). This ensures that the transaction doesn’t go on to completion by accident while
trying do 3-D Secure enrolment or authentication only.
V2.00
- 231 -
GATEWAY
INTEGRATION GUIDE
The 3-D Secure Legacy API was used for 3-D Secure integration prior to the introduction of 3-D
Secure version 2. The API details are documented for backwards compatibility and should not be
used for new integrations.
If your Merchant account is setup for 3-D Secure the Gateway will require further authentication
details provided by the 3-D Secure system.
To ensure the Gateway uses the legacy 3-D Secure API you must not pass any of the following
fields used by the current API:
• threeDSRef
• threeDSRedirectURL
• threeDSURL
• threeDSRequest
• threeDSResponse
The API versions must not be mixed between the initial and continuation requests otherwise an
error will occur.
V2.00
- 232 -
GATEWAY
INTEGRATION GUIDE
If the Gateway determines that the transaction is not eligible for 3-D Secure, then it will continue
and process it as normal transaction without 3-D Secure unless the threeDSRequired request
field indicates that the transaction should be aborted instead.
If the Gateway determines that the transaction is eligible it will respond with a responseCode of
65802 (3DS AUTHENTICATION REQUIRED) and included in the response will be a
threeDSACSURL field containing the URL required to contact the ACS on and a threeDSMD and
threeDSPaReq to send to the provided URL. The latter two values must be posted to the
provided ACS URL as the fields MD and PaReq together with a TermUrl field provided by yourself
which must contain the URL of a page on your server to return to when authentication has been
completed.
If you would like an example of a 3-D Secure integration, please refer to our sample code
appendix A-23.2.
V2.00
- 233 -
GATEWAY
INTEGRATION GUIDE
1 If the value is not supplied, then the default account preferences will be used.
2 The default value is Y if 3-D Secure is enabled on the Merchant Account, otherwise N.
threeDSPaRes Yes The value of the PaRes field POSTed back from the
Access Control Sever (ACS).
1 It is only necessary to send the threeDSMD and the threeDSPaRes in the continuation request as the threeDSMD
will identify the Merchant Account and initial request. The message does not need to be signed. However, you can send any
of the normal request fields to modify or supplement the initial request. Any card details and transaction amount sent in
the second request must match those used in the first request, or the second request will fail with a responseCode of
64442 (REQUEST MISMATCH).
V2.00
- 234 -
GATEWAY
INTEGRATION GUIDE
threeDSXID If 3DS enabled The unique identifier for the transaction in the 3DS
system.
threeDSVETimestamp If 3DS enabled The time the card was checked for 3DS enrolment.
threeDSEnrolled If 3DS enabled The 3DS enrolment status for the credit card.
Refer to appendix A-3 for details.
threeDSACSURL If 3DS enrolled The URL of the Access Control Server (ACS) to
which the Payer Authentication Request (PaReq)
should be sent.
V2.00
- 235 -
GATEWAY
INTEGRATION GUIDE
threeDSCATimestamp If 3DS enrolled The time the card was checked for 3DS
authentication.
threeDSAuthenticated If 3DS enrolled The 3DS authentication status for the credit card.
Refer to appendix A-3 for details.
threeDSCAVVAlgorithm If 3DS This contains the one-digit value that indicates the
authenticated algorithm used by the Access Control Server (ACS)
to generate the CAVV.
threeDSErrorCode If 3DS error Any error response code returned by the Access
Control Server (ACS) if there is an error in
determining the card’s 3DS status.
V2.00
- 236 -
GATEWAY
INTEGRATION GUIDE
3-D Secure Enrolment/Authentication checks can be performed using the legacy 3-D Secure API
as described in appendix A-4, except that the Gateway will return a threeDSMD field instead of a
threeDSRef field. This field can be passed in the next request to continue the transaction.
V2.00
- 237 -
GATEWAY
INTEGRATION GUIDE
checkOnly No Check the request for syntax and field value errors
only. Do not attempt to submit the transaction for
honouring by the Merchant’s financial institution.
If the request is OK, then a responseCode is returned as 0 (Success); otherwise, the code that
would have prevented the request from completing is returned.
Note: in these cases, the request is not stored by the Gateway and is not available within the
Merchant Management System (MMS).
V2.00
- 238 -
GATEWAY
INTEGRATION GUIDE
For example, you can group a Merchant Account that only supports American Express cards with
a Merchant Account that only supports Visa cards. Then, if a request using an American Express
card is sent to the Visa only Merchant Account, the Gateway will automatically route it to the
American Express Merchant Account.
This prevents you from needing to know the card type in advance in order to send the request to
the correct Merchant Account. This is important when using the Hosted integration, because you
don’t know the card type at the time you send the request.
It is usual for you to have one master account to which you direct all requests and then group all
your accounts together.
Any Gateway routing of the transaction can be seen from the following additional response fields:
V2.00
- 239 -
GATEWAY
INTEGRATION GUIDE
For example, you can set up a control that stops a certain card number from being used more than
twice in the space of a few minutes.
If one or more of these controls are broken by a transaction, then the following response fields will
show the problem.
If a transaction is declined through breach of one or more of these rules, then a responseCode of
5 (VCS DECLINE) will be returned.
V2.00
- 240 -
GATEWAY
INTEGRATION GUIDE
To help prevent duplicate transactions, each transaction can specify a time window during which
previous transactions will be checked to see whether they could be possible duplicates.
This time window is specified using the duplicateDelay field. The value for this field can range
from 0 to 9999 seconds (approx. 2 ¾ hours).
If the transaction request does not include the duplicateDelay field or specifies a value of zero,
then a default delay of 300 seconds (5 minutes) is used.
The following fields are used in transaction comparison and must be the same for a transaction to
be regarded as a duplicate:
• merchantID
• action
• type
• amount
• transactionUnique
• currencyCode
• xref (if provided in lieu of card details)
• cardNumber (may be specified indirectly via cross reference)
V2.00
- 241 -
GATEWAY
INTEGRATION GUIDE
Capture Delay enables you to specify a delay between the authorisation of a payment and its
capture. This allows you time to verify the order and choose whether to fulfil it or cancel it. This
can be very helpful in preventing chargebacks due to fraud.
When NOT using capture delay, payments are authorised and captured immediately - funds are
automatically debited from the Customer’s credit or debit card at that time.
When using capture delay, the payment is authorised only at the time of payment - funds are
reserved against the credit or debit card and will not be debited until the payment is captured; or
not at all if you cancel.
The Customer experience with capture delay is the same as when capture delay is not used. The
Customer will not know whether you are using capture delay or not.
If you choose to use capture delay, you can use the captureDelay request field to specify the
number of days for which capture is delayed, within a range of 0 to 30 days. Alternatively, you can
use the value -1 or ‘never’ to specify that the Gateway should never automatically capture in
which case you must manually capture.
The Gateway will automatically capture the transaction after any delay specified unless you
manually cancel or capture the transaction, using either the Direct Integration or via the Merchant
Management System (MMS).
Note that some cards require capture within 4 to 5 days - if payment is not automatically captured
within that period, the transaction will expire, and the reserved funds will be released to the
Customer.
Capture delay allows you to accept online orders normally but allows you to cancel any
transactions that you cannot or will not fulfil, thereby reducing the risks of chargeback. If you
receive an order that appears to be fraudulent or that you cannot or do not wish to fulfil, you can
simply cancel the transaction.
Note: Cancelling a transaction may not always reverse the authorisation and release the funds
back to the Customer. This is dependent on the Acquirer and in these cases the authorisation will
never be settled and will be left to expire releasing any reserved funds. The time taken for this
varies between cards.
Some Acquirers do not support delayed capture, in which case the Hosted Integration will return a
responseCode of 66358 (INVALID CAPTURE DELAY).
V2.00
- 242 -
GATEWAY
INTEGRATION GUIDE
The Gateway primarily supports Mastercard, Visa and American Express branded cards. Some
Acquirers may support JCB, Discover and Diners Club cards. Not all Acquirers support all types.
The card type and scheme codes will be returned in the cardTypeCode and cardSchemeCode
response fields. When available, the issuer details will be returned in the cardIssuer and
cardIssuerCountryCode response fields.
If the Gateway is unable to identify the card, then a code of ‘XX’ will be returned.
The following fields are returned by the Gateway to indicate a cards identity.
cardFlags Bitmask of flags where each bit number indicates the following:
1 – debit (not credit) card.
2 – alternative debit (not credit) card.
3 – prepaid card.
4 – not used.
5 – corporate card (not consumer) card.
6 – not used.
7 – not used.
8 – tokenised card (DPAN not FPAN).
9 – ECOM use allowed.
10 – MOTO use allowed.
11 – EPOS use allowed.
12 – CA use allowed.
13 – LUHN conforming.
14 – 3-D Secure available (doesn’t indicate the card is enrolled).
15 – Contactless available.
1 Issuing institution and country are primarily available for Visa and Mastercard issued cards only.
V2.00
- 243 -
GATEWAY
INTEGRATION GUIDE
MC MC Mastercard Credit
MD MC Mastercard Debit
MI MC Mastercard/Diners Club
MP MC Mastercard Purchasing
VC VC Visa Credit
VD VC Visa Debt
EL VC Visa Electron
VA VC Visa ATM
VP VC Visa Purchasing
AM AM American Express
JC JC JCB
DS DS Discover
DI DI Diners Club
CU CU China UnionPay
V2.00
- 244 -
GATEWAY
INTEGRATION GUIDE
The following is a list of secondary card types recognised by the Gateway. These cards may be
returned in response to a card lookup, but they are either deprecated or most likely not supported
by any current Acquirer.
BC BC BankCard
DK DK Dankort
FC FC FlexCache
LS LS Laser
SO SO Solo
ST ST Style
SW SW Switch
TP TP Tempo Payments
IP IP InstaPayment
V2.00
- 245 -
GATEWAY
INTEGRATION GUIDE
Test Merchant Accounts are not connected to our Simulator and not to an actual Acquirer. The
Simulator will emulate the function of an Acquirer and provide simulated responses and
authorisation codes.
15000 (150.00) 19999 (199.99) (4) CARD DECLINED – KEEP CARD N/A
Any other amount will return a responseCode of 66311 (Invalid Test Amount).
The settlement outcome only applies to transactions which reach settlement due to being
successfully authorised and captured and not cancelled. The amount captured is used when
determining the settlement outcome rather than the amount authorised.
V2.00
- 246 -
GATEWAY
INTEGRATION GUIDE
The range 5000 to 9999 can be used to test manual authorisations. If the transaction does not
contain an authorisationCode request field, then the Simulator will return a responseCode of
1 (CARD REFERRED). If it does, then it will return a responseCode of 0 (SUCCESS), with an
amount between 50000 and 7499 being accepted at settlement and an amount of 7500 to 9999
being rejected.
The range 20000 to 29999 can be used to test SCA soft declines. If the transaction is eligible1 to
request SCA then the Simulator will return a responseCode of 65 (SCA REQUIRED). If not, then
it will return a responseCode of 0 (SUCCESS) for the range 20000 to 24999 or 5 (DO NOT
HONOR) for the range 25000 to 29999. Successful transactions will be approved at settlement.
1 A cardholder-initiated e-commerce sale or verify transaction that is enabled for 3-D Secure but is not already
authenticated. SCA exemptions are not supported by the simulator and so cannot be used to request that SCA is not
required.
V2.00
- 247 -
GATEWAY
INTEGRATION GUIDE
To test AVS and CV2 verification then the associated CVV and billing addresses are provided for
each card. If a different value is used, then the Simulator will mark the responses as ‘not matched’.
Unless stated otherwise an expiry date sometime in the near future should be used.
Flat 6
Primrose Rise
4929421234600821 356 347 Lavender Road
Northampton
NN17 8YG
76 Roseby Avenue
4543059999999982 110 Manchester
M63X 7TH
23 Rogerham
Mansions
4543059999999990 689 4578 Ermine Street
Borehamwood
WD54 8TH
Unit 5
Pickwick Walk
120 Uxbridge Road
4539791001730106 289
Hatch End
Middlesex
HA6 7HJ
Mews 57
4462000000000003 672 Ladybird Drive
Denmark 65890
A-12.2.3 Electron
Card Number CVV Address
V2.00
- 248 -
GATEWAY
INTEGRATION GUIDE
25 The Larches
Narborough
5301250070000191 419
Leicester
LE10 2RT
Merevale Avenue
5573 4712 3456 7898 159 Leicester
LE10 2BU
A-12.2.6 UK Maestro
Card Number CVV Address
The Parkway
5258 Larches Approach
6759 0150 5012 3445 002 309 Hull
North Humberside
HU10 5OP
The Manor
Wolvey Road
6759 0168 0000 0120 097 701
Middlesex
TW7 9FF
V2.00
- 249 -
GATEWAY
INTEGRATION GUIDE
A-12.2.7 JCB
Card Number CVV Address
2 Middle Wallop
Merideth-in-the-Wolds
3540599999991047 209
Lincolnshire
LN2 8HG
1Diners Club do not support the Address Verification Service (AVS). For testing purposes, we advise that a separate
Merchant Account is used with AVS is turned off.
V2.00
- 250 -
GATEWAY
INTEGRATION GUIDE
Your test accounts are connected to our 3-D Secure Product Integration Testing (PIT) system
rather than to the production 3-D Secure servers.
You can use any of the test cards provided in section A-12.2 with this PIT system and can test
various enrolment and authentication scenarios as follows.
V2.00
- 251 -
GATEWAY
INTEGRATION GUIDE
An expiry month of 12 will simulate the non frictionless flow and desired authentication status
(threeDSAuthenticated) can be selected on the challenge dialog shown by the PIT Access
Control Server.
When using an expiry month from the above table please use a suitable expiry year to ensure the
date is sometime in the near future.
V2.00
- 252 -
GATEWAY
INTEGRATION GUIDE
Please contact customer support to have your own PayPal test Merchant account created that
connects to your own PayPal sandbox account, thus enabling you to view the transactions as they
are sent to PayPal.
Please contact customer support to have your own Amazon Pay test Merchant account created
that connects to your own Amazon Pay sandbox account, thus enabling you to view the
transactions as they are sent to Amazon Pay.
V2.00
- 253 -
GATEWAY
INTEGRATION GUIDE
It is highly recommended that transactions are protected using message signing. The signing
process offers a quick and simple way to ensure that the message came from an authorised
source and has not been tampered with during transmission .
Signing, however, must be completed on your servers and never left for the Customer’s browser to
complete in JavaScript, as this would mean revealing your secret signature code to anyone who
viewed the JavaScript code in the browser.
Signatures are especially important when a transaction is sent from a browser’s payment form via
the use of hidden form fields because the Customer can easily use tools built into their browser to
modify these hidden fields and change items such as the amount they should be charged.
Care must be taken to ensure that fields are sorted before signing into ascending field name order
according to their numeric ASCII value. Some languages natural sort routines do NOT use ASCII
order by default and so need to be adjusted or alternative methods used.
Also, when signing requests with fields formatted as per the record format detailed in section
1.7.8, only the root integration field is included in any sorting as the sub-fields are part of the value
and should not have their order changed. The sub-fields must then be sent in the same order as
they were hashed if added as hidden fields in HTML forms etc.
The section below gives a step-by-step example of how to sign a transaction, complete with
coding examples using the PHP language.
$key = 'DontTellAnyone'
Example Transaction:
$tran = array (
'merchantID' => '100001',
'action' => 'SALE',
'type' => '1',
'currencyCode' => '826',
'countryCode' => '826',
'amount' => '2691',
'transactionUnique' => '55f025addd3c2',
'orderRef' => 'Signature Test',
'cardNumber' => '4929 4212 3460 0821',
'cardExpiryDate' => '1213',
)
The transaction used for signature calculation must not include any 'signature' field as this
will be added after signing when its value is known.
V2.00
- 254 -
GATEWAY
INTEGRATION GUIDE
array ( 'action' => 'SALE', 'amount' => '2691', 'cardExpiryDate' => '1213',
'cardNumber' => '4929 4212 3460 0821', 'countryCode' => '826', 'currencyCode' => '826',
'merchantID' => '100001', 'orderRef' => 'Signature Test', 'transactionUnique' =>
'55f025addd3c2', 'type' => '1' )
action=SALE&amount=2691&cardExpiryDate=1213&cardNumber=4929+4212+3460+0821&countryCode=
826¤cyCode=826&merchantID=100001&orderRef=Signature+Test&transactionUnique=55f025
addd3c2&type=1
action=SALE&amount=2691&cardExpiryDate=1213&cardNumber=4929+4212+3460+0821&countryCode=
826¤cyCode=826&merchantID=100001&orderRef=Signature+Test&transactionUnique=55f025
addd3c2&type=1
action=SALE&amount=2691&cardExpiryDate=1213&cardNumber=4929+4212+3460+0821&countryCode=
826¤cyCode=826&merchantID=100001&orderRef=Signature+Test&transactionUnique=55f025
addd3c2&type=1DontTellAnyone
da0acd2c404945365d0e7ae74ad32d57c561e9b942f6bdb7e3dda49a08fcddf74fe6af6b23b8481b8dc8895
c12fc21c72c69d60f137fdf574720363e33d94097
or
$tran['signature'] = $signature;
V2.00
- 255 -
GATEWAY
INTEGRATION GUIDE
The key stages in the transaction’s life cycle can be grouped into the Authorisation, Capture and
Settlement stages as follows:
A-14.1.1 Authorisation
An authorisation places a hold on the transaction amount in the Cardholder’s issuing bank. No
money actually changes hands yet. For example, let’s say that you are going to ship a physical
product from your website. First, you authorise the amount of the transaction; then you ship the
product. You only capture the transaction after the product is shipped.
A-14.1.2 Capture
A capture essentially marks a transaction as ready for settlement. As soon as the product is
shipped, you can capture an amount up to the amount of the authorisation. Usually, the full
amount is captured. An example of a situation in which the whole amount is not captured is where
the Customer ordered multiple items and one of them is unavailable.
The Gateway will normally automatically capture all authorisations as soon as they are approved,
freeing up you from having to do this.
However, it is usually more desirable to delay the capture either for a period of time or indefinitely.
The captureDelay field can be used for this purpose and will allow you to state the number of
days to delay any automatic capture or never to automatically capture. For more details on
delayed capture, refer to appendix A-9.
A-14.1.3 Settlement
Within 24 hours, the Gateway will instruct your Acquirer to settle the captured transaction. The
Acquirer then transfers the funds between the Cardholder’s and your accounts.
V2.00
- 256 -
GATEWAY
INTEGRATION GUIDE
At any time during the transaction’s life cycle, it is in one of a number of states as follows:
A-14.2.1 Received
The transaction has been received by the Gateway and stored away. This is the first stage. The
Gateway will examine the transaction and pass it on to the next stage, as appropriate.
A-14.2.2 Approved
The transaction has been sent to the Acquirer for authorisation and the Acquirer has approved it
and is holding the Cardholder’s funds.
A-14.2.3 Verified
The transaction has been sent to the Acquirer for verification and the Acquirer has confirmed that
the account is valid.
This is a terminal state and follows the received state. The transaction will never be settled and no
funds will ever be transferred
A-14.2.4 Declined
The transaction has been sent to the Acquirer for authorisation and the Acquirer declined it.
The Acquirer will not usually give any reason for a decline and will not have held any funds.
The transaction has now completed its life cycle and no more processing will be done on it.
This is a terminal state and follows the received state. The transaction will never be settled and no
funds will ever be transferred. The transaction responseCode will be 5 (Declined).
A-14.2.5 Referred
The transaction has been sent to the Acquirer for authorisation and the Acquirer referred it for
verbal approval.
You can choose not to seek verbal approval and treat these transactions the same as a normal
‘declined’ authorisation.
To seek verbal approval, you must phone the Acquirer and ask for an authorisation code. They will
probably ask for more information about the transaction and might require you to gather other
forms of identification from the Cardholder. If an authorisation code is provided, then a new
transaction can be sent to the Gateway specifying the xref of this transaction and the received
authorisationCode. This new request will not be sent for authorisation and will be in the
‘approved’ state ready for capture and settlement.
V2.00
- 257 -
GATEWAY
INTEGRATION GUIDE
This is a terminal state and follows the received state. The transaction will never be settled and no
funds will ever be transferred. The transaction responseCode will be 2 (Referred).
A-14.2.6 Reversed
The transaction was sent to the Acquirer for authorisation and the Acquirer approved it. However,
the transaction has been voided and the approval reversed. The Acquirer will have been asked to
reverse any approval previously received, effectively cancelling the authorisation and returning
any held funds back to the Cardholder.
The gateway will reverse an authorisation if it declines the transaction post authorisation due to
any AVS/CV checking. The PREAUTH action will also automatically reverse an authorisation
before return.
This is a terminal state and follows the approved state. The transaction will never be settled and
no funds will ever be transferred.
If the transaction was reversed due to AVS/CV2 checking, then the transaction responseCode
will be 5 (AVS/CV2 Declined).
A-14.2.7 Captured
The transaction has been captured and the Acquirer will be asked to capture the approved held
funds when the settling process next runs. The settling process usually runs each evening but the
Acquirer may take up to 3 days to transfer the funds.
The capture state can either be entered automatically if the transaction requested an immediate
or delayed capture; or it can be manually requested by sending a CAPTURE request. You are free
to change the amount to be captured to a value less than that initially approved by issuing one or
more CAPTURE commands. When captured, there is no way to un-capture a transaction. If not
explicitly cancelled, it will be sent for settlement at the next opportunity.
A-14.2.8 Tendered
The transaction has been sent to the Acquirer for settlement by the settling process and is
awaiting confirmation that it has been accepted.
A-14.2.9 Deferred
The transaction could not be settled due to some temporary problem such as a communications
loss. It will be attempted again the next time the settling process runs – usually first thing the next
day.
This is an intermediate state and follows the tendered state. It will normally be accompanied by a
transaction response that indicates why the settlement process could not settle the transaction.
V2.00
- 258 -
GATEWAY
INTEGRATION GUIDE
A-14.2.10 Accepted
The transaction has been accepted for settlement by the Acquirer. The held funds will be
transferred between the Merchant and Cardholder in due course.
The transaction has now completed its life cycle and no more processing will be done on it, unless
it is subject to a rejection while the Acquirer is settling it.
A-14.2.11 Rejected
The transaction has been rejected for settlement by the Acquirer. The held funds will not be
transferred between the Merchant and Cardholder.
Only a few Acquirers inform the Gateway that they have rejected a transaction: they usually inform
you directly. Therefore, a transaction may show as accepted even if was ultimately rejected or it
may change from accepted to rejected if the Acquirer does inform the Gateway.
The transaction has now completed its life cycle and no more processing will be done on it.
This is a terminal state and follows the tendered or accepted states. The transaction response
will normally indicate the reason the transaction was rejected.
A-14.2.12 Canceled
The transaction has been cancelled by the Merchant by sending a cancellation request to the
Gateway either using the CANCEL action or via the Merchant Management System (MMS).
You can cancel any transaction that is not in a terminal state or in the ‘tendered’ state. When
cancelled, any further processing that would have normally taken place will be halted. Cancelling
a transaction may or may not release any funds held on the Cardholder’s card, depending on
support from the Acquirer and card scheme. Note: the state is spelt American style, with a single ‘l’
as canceled.
This is a terminal state and follows any non-terminal state that occurs before the transaction
reaches the tendered state.
A-14.2.13 Finished
The transaction has finished and reached the end of its lifespan but did not reach one of the other
terminal states. Usually this indicates that a problem has occurred with the transaction that
prevents it continuing with its normal life cycle.
This is a terminal state and can follow any other state. The transaction response will normally
indicate the reason that the transaction failed.
V2.00
- 259 -
GATEWAY
INTEGRATION GUIDE
The type of transaction required is specified using the type request field when performing a new
payment transaction.
E-commerce transactions are supported by the Gateway by using a transaction type of 1. They
are designed for you to accept payments via a website, such as a shopping cart payment. E-
commerce transactions can use advance fraud detection, such as 3-D Secure.
In accordance with Mastercard stipulations, the Gateway will not allow Maestro cards to be used
for new e-commerce transactions without the use of 3-D Secure.
Mail Order/Telephone Order transactions are supported by the Gateway by using a transaction
type of 2. They are designed for you to build your own virtual terminal system to enter remote
order details. MOTO transactions cannot use 3-D Secure as the cardholder is not able to perform
the challenge.
Your Acquirer may need to enable MOTO capabilities on your main acquiring account, or they
provide a separate acquiring account which will be available through its own Gateway Merchant
Account.
Continuous Authority transactions are supported by the Gateway by using a transaction type of 9.
They are designed for you to make subscription transactions. For further details on how to use
Continuous Authority transactions, please refer to section Error! Reference source not found..
Your Acquirer may need to enable Continuous Authority capabilities on your main acquiring
account, or they provide a separate acquiring account which will be available through its own
Gateway Merchant Account.
The Gateway offers a means of automating the taking of regular CA transactions using Recurring
Transaction Agreements (RTA) as detailed in section 12.
V2.00
- 260 -
GATEWAY
INTEGRATION GUIDE
The cross reference can be sent as part of a transaction request, in the xref request field, to tell
the Gateway to perform an action on an existing transaction. This is usually for management
actions such as CANCEL or CAPTURE.
The cross reference can also be sent with new transactions such as PREAUTH, SALE, and
REFUND actions, to request that the Gateway uses the values from the existing transaction if they
have not been specified in the new request. For more information on how the existing values are
used, please refer to appendix A-17. This allows an existing transaction to be effectively repeated
without your needing to know the original card number. The only exception to this is the card’s
security code (CVV) which the Gateway cannot store, due to PCI DSS restrictions. Accordingly, it
will have to be supplied in the new request (unless the new request is a Continuous Authority
transaction, refer to appendix A-15.3).
The use of cross references to perform repeat transactions is referred to as Payment Tokenisation
and should not be confused with Card Tokenisation which is a separate service offered by the
Gateway.
Refer to section 12 for details on how to instruct the Gateway to repeat a payment automatically.
The xref field can be provided to reference an existing transaction, which will be used to
complete any missing fields in the current transaction. The previous transaction will not be
modified. For more information on how the existing values are used, please refer to appendix A-
17. If the existing transaction cannot be found, then an error will be returned and recorded against
the new transaction
The xref will only be used to complete any missing card and order details, relieving you from
having to store card details and reducing your PCI requirements.
V2.00
- 261 -
GATEWAY
INTEGRATION GUIDE
The xref field can be provided to reference an existing transaction that is going to be refunded.
This existing transaction will be marked as have been fully or partially refunded and the amounts
will be tallied to ensure that you cannot refund more than the original amount of this existing
transaction. If the existing transaction cannot be found, then an error will be returned and recorded
against the new transaction.
The xref will not only be used to find the transaction to be refunded: additionally, that transaction
will be used to complete any missing card and order details, relieving you from having to store
card details and reducing your PCI requirements.
The xref field must be provided to reference an existing transaction, which will be modified to the
desired state. If the existing transaction cannot be found, then an error is returned but no record of
the error will be recorded against any transaction.
The request must not contain any new transaction information any attempt to send any new
transaction information will result in an error. The exception is that a CAPTURE request can send
in a new lesser amount field when a lesser amount, than originally authorised, must be settled.
The xref field must be provided to reference an existing transaction, which will be returned as if it
had just been performed. If the existing transaction cannot be found, then an error is returned but
no record of the error will be recorded against any transaction.
The request must not contain any new transaction information and any attempt to send any new
transaction information will result in an error.
V2.00
- 262 -
GATEWAY
INTEGRATION GUIDE
The xref field must be provided to reference an existing transaction, which must be of the same
request type and be in the referred state. A new transaction will be created based upon this
transaction. If the existing transaction cannot be found or is not in the referred state, then an error
will be returned and recorded against the new transaction.
The new transaction will be put in the approved state and captured when specified by the existing
or new transaction details. It will not be sent for authorisation again first.
The request may contain new transaction details, but any card details or order amount must be the
same as the existing transaction. Any attempt to send different card details or order details will
result in an error.
NB: This usage is very similar to a normal SALE or REFUND request sent with an
authorisationCode included. The difference is that the xref must refer to an existing referred
transaction whose full details are used if required and not simply an existing transaction whose
card details are used if required.
This means it is not possible to create a pre-authorised SALE or REFUND request and use a
xref (ie to use the card and order details from an existing transaction). As a soon as the xref
field is seen, the Gateway identifies that it is a referred transaction that you wish to authorise.
V2.00
- 263 -
GATEWAY
INTEGRATION GUIDE
Appendix A-17.1 shows all the fields whose values can be copied over from the existing
transaction. To allow for easy addition of future fields, the fields are grouped into logical groupings
and each group is given a name, given in brackets after the group title.
Certain groups of fields, such as address fields, can only be copied as a whole entity and any new
value provided in the new request will prevent the whole group from being copied from the existing
transaction. These fields are marked with an asterisk after the field name. This is explained in
appendix A-17.2.1.
By default, the values of all the fields listed in appendix A-17.1 are copied from the existing
transaction where appropriate. However, you can control exactly which fields are copied using the
cloneFields field in the new request. The value of cloneFields should be a comma
separated list of field names or group names that should be copied over. Alternatively, if you wish
to specify a list of fields not to copy, then prefix the list with a single exclamation mark (!).
Examples
To copy over only the value of customerName and any values for the fields in the
customerAddressFields group:
cloneFields=”customerName, customerAddressFields”
To copy over the values of all supported fields apart from the value of customerName and
merchantName:
cloneFields=”!customerName,merchantName”
V2.00
- 264 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 265 -
GATEWAY
INTEGRATION GUIDE
1 3-D Secure fields are only cloned if both the existing and new transaction support 3-D Secure.
V2.00
- 266 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 267 -
GATEWAY
INTEGRATION GUIDE
1 Payment facilitator fields are only cloned if the existing transaction uses the same merchantID as the new transaction.
V2.00
- 268 -
GATEWAY
INTEGRATION GUIDE
To allow for easy future addition of new fields, the existing fields are grouped into logic groupings.
Each group is given a name (as shown in brackets after the group title). It is recommended that
this group name be used in any cloneFields value instead of listing all the fields separately.
These compound fields are marked with an asterisk in appendix A-17.1 and can be referred to in
cloneFields as logical groups using the following group names; merchantAddressFields,
customerAddressFields, deliveryAddressFields, supplierAddressFields and
receiverAddressFields.
If a new amount value is passed that is different from the value in the existing transaction, then
the following fields should also be passed so that they tally with the new amount.
• grossAmount
• netAmount
• taxRate
• discountAmount
V2.00
- 269 -
GATEWAY
INTEGRATION GUIDE
Cardholder opts to store CIT Ecom Initial Required consumer 1 cardonfile (Optional for cloning)
their card details on
Merchant's website.
Cardholder opts to store CIT MoTo Initial Exempt consumer 2 cardonfile (Optional for cloning)
their card details provided to
Merchant via mail or
telephone.
Cardholder pays using a CIT Ecom Subsequent Required consumer 1 cardonfile Reference to
card they previously stored transaction that initially
on the Merchant's website. stored the card
Cardholder provides their CIT Ecom Initial or Required consumer 1 recurring (Optional for cloning or
card details to sign up to a Subsequent using previous stored
subscription on the card)
Merchant's website.
Cardholder provides their CIT Ecom Initial or Required consumer 1 instalment (Optional for cloning or
card details when agreeing Subsequent using previous stored
to purchase by instalments card)
on The Merchant's website.
Cardholder provides their CIT MoTo Initial or Exempt consumer 2 recurring (Optional for cloning or
card details to sign up to a Subsequent using previous stored
subscription via mail or card)
telephone to the Merchant.
Cardholder provides their CIT MoTo Initial or Exempt consumer 2 instalment (Optional for cloning or
card details when agreeing Subsequent using previous stored
to purchase by instalments card)
via mail or telephone to the
Merchant.
Merchant/Gateway takes an MIT CNP Subsequent Exempt merchant 9 recurring Reference to initial or
automatic subscription previous recurring
payment at the interval payment
agreed to by the
Cardholder.
Merchant/Gateway makes MIT CNP Subsequent Exempt merchant 9 instalment Reference to initial or
an automatic instalment previous instalment
payment at the interval payment
agreed to by the
Cardholder.
Merchant resubmits a MIT CNP N/A Exempt merchant 2 resubmission Reference to initial
payment where the initial payment that was
payment was declined due declined
to insufficient funds, but the
goods have already been
provided to the Cardholder.
V2.00
- 270 -
GATEWAY
INTEGRATION GUIDE
Merchant reauthorises a MIT CNP N/A Exempt merchant 2 reauthorisation Reference to payment
payment when the that is to be
completion or fulfilment of reauthorised
the original order or service
extends beyond the
authorization validity limit
set by the card scheme.
Merchant makes a payment MIT CNP N/A Exempt merchant 2 delayedcharges Reference to original
to process a supplemental payment to which the
account charge after original delayed charges relate
services have been
rendered and respective
payment has been
processed.
Merchant makes a payment MIT CNP N/A Exempt merchant 2 noshow Reference to an initial
to charge the Cardholder a CIT payment or account
penalty according to the verification payment
merchant’s reservation made by Cardholder at
cancellation policy. time of booking
V2.00
- 271 -
GATEWAY
INTEGRATION GUIDE
PSD2 is for banks, not for merchants. This means that to comply with the law in their home
country, banks must refuse non-compliant payments. To avoid the risk of the bank declining your
payment, you as a merchant need to ensure that your payments comply with PSD2 SCA
regulations.
You can comply by obtaining additional authentication to verify the Customer’s identity or by
providing a valid reason for the payment to be exempt from SCA. Any authentication must use a
least two of the following three elements:
1. Something the Customer knows (eg password)
2. Something the Customer has (eg phone)
3. Something the Customer is (eg fingerprint)
1PSD2 countries are: Austria, Belgium, Bulgaria, Croatia, Republic of Cyprus, Czech Republic, Denmark, Estonia, Finland,
France, Germany, Greece, Hungary, Iceland, Ireland, Italy, Latvia, Liechtenstein, Lithuania, Luxembourg, Malta, Monaco,
Netherlands, Norway, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden, and the UK.
V2.00
- 272 -
GATEWAY
INTEGRATION GUIDE
Strong Customer Authentication applies to Customer entered online transactions (ECOM). Mail
Order/Telephone Order (MOTO) transactions and recurring transactions are considered Merchant
entered transactions and do not require strong authentication.
Currently, the most common way of authenticating an online card payment is to use 3-D Secure as
covered in section 5. Both 3-D Secure version 1 and version 2 are accepted as a means of
obtaining Cardholder authentication for the purposes of SCA.
Other card-based payment method such as Apple Pay and some Google Pay payments already
support payment flows with a built-in layer of strong authentication (biometric or password). These
can be a great way for you to offer a frictionless checkout experience while meeting the new
requirements.
We also expect many alternative European payment methods such as PayPal, Amazon Pay,
iDEAL, etc. to follow the new SCA rules without any major changes to their user experience.
There are two main types of card transaction declines: hard declines and soft declines.
Hard declines happen when the issuing bank rejects the transaction. Examples include attempting
to use a card that has been reported lost or stolen, or the card has expired. Hard declines are
permanent, so the payment should not be retried.
Soft declines are temporary authorisation failures. Around 80% to 90% of all declines fall into this
category. They occur for a host of reasons including the need to authenticate the Cardholder
further or because there are issues with the technical infrastructures that process the transaction.
Soft declines are temporary, meaning you can process the transaction again after meeting the
requirements that led to the decline the first time around.
If you do not obtain SCA on an eligible payment the issuer may soft decline the payment insisting
that SCA be obtained. In which case a responseCode of 65 will be returned by the Gateway1 and
you can choose to resubmit the payment with SCA if required.
Refer to appendix A-19.4 for details on how you can use 3-D Secure to obtain SCA and
automatically retry payments that have been soft declined for this reason. If 3-D Secure has been
used to provide SCA and the issuer still declines insisting that SCA be obtained, then the Gateway
will return a normal decline responseCode of 5 to prevent an infinite loop of obtaining SCA and
then being declined for lack of SCA.
1Mastercard will return an ISO-8583 code of 65, Visa/Diners/Discover and others will return an ISO-8583 code of 1A.
The Gateway will normalise these and always return a responseCode of 65.
V2.00
- 273 -
GATEWAY
INTEGRATION GUIDE
There are some e-commerce transactions which are out of scope of the regulation, and others that
may be exempt.
Obtaining Strong Customer Authentication can add friction and increase Customer drop-off and
therefore you should make use of exemptions to reduce the number of times you will need to
authenticate a Customer.
However, the bank has the right to refuse any requested exemption and decline the payment
insisting that SCA be obtained. Refer to appendix A-19.2 for further information on this soft
decline.
You can flag such payments by passing a value of ‘2’ in the type request field.
The initial payment that saved the card will still need to have obtained SCA or be exempt and
agreement must be obtained from the Customer to charge their card at a later point.
You can flag such payments by passing a value of ‘9’ (Continuous Authority) in the type request
field or using an rtAgreementType that signifies the transaction as being Merchant Initiated.
You can request this exemption by passing a value of ‘lowvalue’ in the scaExemption request
field, or it may be automatically applied by the Issuer.
You can request this exemption by passing a value of ‘trusted’ in the scaExemption request
field to allow this trust to be taken into consideration.
V2.00
- 274 -
GATEWAY
INTEGRATION GUIDE
You can request this exemption by passing a value of ‘risk’ in the scaExemption request field if
agreed to by the payment provider.
You can request this exemption by passing a value of ‘corporate’ in the scaExemption request
field to indicate such a secure transaction.
You can request this exemption by passing a value of ‘delegated’ in the scaExemption request
field to indicate such a secure transaction.
V2.00
- 275 -
GATEWAY
INTEGRATION GUIDE
3-D Secure can be used to provide the necessary Strong Customer Authentication. However, 3-D
Secure is normally always performed before authorisation to gain the liability shift but this might
not be desirable if it is only being used as means of obtaining SCA and you initially want to attempt
the payment with an exemption instead of adding the friction of obtaining SCA up front.
You therefore have a choice of how and when to use 3-D Secure to satisfy SCA as follows:
The Gateway can support both choices and in the case of the second choice it can automatically
perform the repeat the transaction on your behalf.
The choice of how and when authentication is performed is indicating by select a 3-D Secure
Policy in the Merchant Management System or by sending the threeDSPolicy field in the
request.
The [PSD2] policies will perform 3-D Secure authentication only if the transaction falls within the
jurisdiction of the European Union's Payment Services Directive 2, otherwise it will behave as if
3-D Secure had not been required.
1 An exemption can be explicitly requested using the scaExemption field, refer to appendix A-19.3.
2 The Gateway will use the correct ‘requestorChallengeIndicator’ unless overridden by any value passed in the request.
3 The issuer will soft decline the transaction indicating SCA is required, refer to appendix A-19.2.
4 You are advised to send a threeDSOptions ‘requestorChallengeIndicator’ value of 4 to mandate a challenge.
V2.00
- 276 -
GATEWAY
INTEGRATION GUIDE
You can control which payment methods are displayed and the default or initial value to display in
the input fields.
You can also state which fields you require to be mandatory, in which case the payment form may
not be submitted until the Cardholder has complete all the mandatory fields. On the standard
modal Hosted Payment Page, the mandatory requirement can also control whether the field needs
to be displayed. A value of ‘Y’ or ‘N’ means the field must be displayed, ‘Y’ indicates that a value
must be supplied, while ‘N’ indicates the value can be blank. Omitting the request field means that
the field need not be displayed if the form can provide a better user experience without it.
Not all fields may be supported if you have a customised Hosted Payment Page.
cardCVV No2 Default value for the Card security number field.
V2.00
- 277 -
GATEWAY
INTEGRATION GUIDE
1 This should only be used by Merchants who are storing Card numbers as per PCI DSS requirements.
2 This should only be used for test purposed as Merchants are not allowed to store Card CVV numbers.
3 Same as customerNameMandatory only the name must be provided as at least two words of two or more characters.
V2.00
- 278 -
GATEWAY
INTEGRATION GUIDE
These libraries include simple sever-side classes in many popular programming languages
through to client-side scripts to help with the integration of the Hosted Payment Page or Hosted
Payment Fields.
The client-side libraries can be downloaded directly from the Gateway server.
V2.00
- 279 -
GATEWAY
INTEGRATION GUIDE
A simple server-side integration library is available to simplify the preparation and transmission of
Hosted and Direct Integration requests.
The library is available in many popular programming languages and is based around a single
class: the Gateway class.
The Gateway integration library does not currently support the preparation and
transmission of Batch Integration requests.
merchantID string Your unique Merchant ID to be passed in the merchantID integration field.
merchantPwd string Any password configured on your Merchant Account as per section 1.8.1.
merchantSecret string Any secret configured on your Merchant Account as per section 1.8.2.
proxyUrl string Absolute URL to any proxy required for connections. (eg https://www.proxy.com:3128)
V2.00
- 280 -
GATEWAY
INTEGRATION GUIDE
Return an HTML fragment that can be included in your webpage to render a <form> which will
send the provided request data to the Gateway’s Hosted Integration when submitted.
The request parameter should be an associative array containing the request fields required to
be sent. The request fields are not validated.
The following class properties are used unless alternative values are provided in the request
array: directUrl, merchantID, merchantPwd, merchantSecret.
The options parameter is an optional associative array containing options that can be used to
modify the returned HTML fragment as follows:
• formAttrs – string containing additional attributes to include in the form tag.
• submitAttrs – string containing additional attributes to include in the submit button tag.
• submitImage – string containing the URL to use as the submit button.
• submitHtml – string containing HTML to use as the label on the submit <button>.
• submitText – string containing text to use as the label on the submit <input>.
The submitImage, submitHtml and submitText options are mutually exclusive and will be
checked for in that order. If none is provided, then a submitText value of ‘Pay Now' is
assumed.
If a merchantSecret is provided, then the method will add the correct signature field to the
request.
The verifyResponse() method can be used to validate and decode any response POSTed
back to your website.
Please refer to appendix A-24.1.1 for an example of how to use this method.
Returns a string containing the HTML fragment if successful; throws an exception otherwise.
V2.00
- 281 -
GATEWAY
INTEGRATION GUIDE
Return the response received when sending the provided request to the Gateway’s Direct
Integration.
The request parameter should be an associative array containing the request fields required to
be sent. The request fields are not validated.
The following class properties are used unless alternative values are provided in the request
array: directUrl, merchantID, merchantPwd, merchantSecret.
The options parameter is not used and reserved for future use.
If a merchantSecret is provided, then the method will add the correct signature field to the
request and check the signature field on the response.
An exception is thrown if the request cannot be sent; or the response cannot be received; or if
the response’s signature is incorrect.
Please refer to appendix A-24.1.2 for an example of how to use this method.
Returns an associative array containing the received response fields; otherwise, throws an
exception.
V2.00
- 282 -
GATEWAY
INTEGRATION GUIDE
The request parameter should be a reference to an associative array containing the request
fields required to be sent. The request fields are not validated.
The merchantID and merchantPwd configuration properties will be added to the request.
A few known Gateway response fields will be removed from the request, if present, to avoid
confusion, notably the responseCode, responseMessage, responseStatus, state fields.
An exception will be thrown if the request does not contain an action element or a merchantID
element (and none could be inserted).
The response parameter should be a reference to an associative array containing the response
received from the Gateway, either from the Direct Integration or as POSTed from the Hosted
Integration.
The secret parameter should be any Merchant secret to use when checking the response’s
signature element. If not provided, then the value of the merchantSecret property is used.
An exception is thrown if the response is not valid, does not contain a responseCode element
or its signature is incorrect.
Please refer to appendix A-24.1.1 for an example of how to use this method.
V2.00
- 283 -
GATEWAY
INTEGRATION GUIDE
The request parameter should be a reference to an associative array containing the request
fields required to be sent. The request fields are not validated.
The secret parameter should be the Merchant secret to use when signing the request.
The partial parameter should be either the boolean false or comma separated string; or an
array of strings containing the names of the request elements to sign.
V2.00
- 284 -
GATEWAY
INTEGRATION GUIDE
A simple client-side script is available to simplify the displaying of the Hosted Payment Page in a
lightbox overlaying your website.
The library is available as a JavaScript script and is based around a single class: the Form class.
The script is compatible with most modern web browsers.
The script can be loaded directly from our Gateway server as follows1.
1. <script src="https://gateway.example.com/sdk/web/v1/js/hostedforms.min.js"></script>
If the script detects the presence of the jQuery API, then it will extend the jQuery object with its
own plugin method. However, jQuery is not needed in order to use the script.
The standard Hosted Integration examples redirect the Customer’s browser to the Hosted
Payment Page, resulting it appearing on a new browser page and not overlaying your website.
The Hosted Payment Page library provides the scripting necessary to result in the redirection,
causing the Hosted Payment Page to appear in an overlay and not a new browser page, without
your having to make any modifications to your website. The library can also simplify the creation of
the Hosted Integration redirection FORM if required.
- 285 -
GATEWAY
INTEGRATION GUIDE
Form(element, data)
The element parameter should be either the id or DOM node of an existing FORM or DIV DOM
element.
If the element is a DIV node, then the data is used to create a new FORM node within the
element.
If the element is a FORM node, then the data is used to modify the existing FORM element.
The data parameter should be an object containing construction details and can contain the
following optional properties:
• id – string containing the value to use as the FORM tag’s id attribute.
• url – string containing the URL to use as the FORM tag’s src attribute.
• attrs – object whose properties are added as additional attributes on the FORM tag.
• modal – boolean indicating that the HPP should open in a modal overlay.
• data – object whose properties are added as hidden input elements in the FORM.
• submit – object containing details for a submit button that should be added to the FORM.
o type – type of submit button, either ‘auto’, ‘image’, ‘button’, ‘input’
o id – string containing the value to use as the submit button’s id attribute.
o attrs – object whose properties are added as additional attributes on the submit button.
o label – string containing button label (or ‘alt’ attribute for ‘image’ buttons)
o src – string containing image URL for ‘image’ buttons.
The constructor will submit the FORM immediately after preparation if the data.submit.type
property is ‘auto’; or if the existing FORM element has a data-hostedform-autosubmit
attribute. Otherwise, an event handler will be attached to the submit button to disable it
automatically when clicked, to help prevent your Customer from clicking it twice.
The constructor will prepare the FORM so that the Hosted Payment Page (HPP) will be opened in
a modal overlay if the data.modal property is true; or if the existing FORM element has a data-
hostedform-modal attribute; or has an action attribute containing the string ‘modal/’ or ending
in the string ‘modal’.
The modal overlay is automatically created as a semi-opaque IFRAME element that fills the
browser display. The Hosted Payment Page is then loaded into this IFRAME and being semi-
opaque, your shopping cart will remain visible beneath, but greyed out and noninteractive. When
the Customer closes the Hosted Payment Page, then their browser will be redirected to the URL
you provided using the redirectURL parameter. This will cause the original page and IFRAME
to be replaced by your new page.
V2.00
- 286 -
GATEWAY
INTEGRATION GUIDE
void destroy()
Destroys the Form, reverting its element back to its original state.
V2.00
- 287 -
GATEWAY
INTEGRATION GUIDE
$(element).hostedForm(data);
$(element).hostedForm(‘destroy’);
V2.00
- 288 -
GATEWAY
INTEGRATION GUIDE
A simple client-side script is available to support the displaying of Hosted Payment Fields in your
payment form.
The library is available as a JavaScript script and is based around two classes: the Form and
Field classes. The script is compatible with most modern web browsers.
The script can be loaded directly from our Gateway server as follows1:
1. <script src="https://gateway.example.com/sdk/web/v1/js/hostedfields.min.js"></script>
The script requires the jQuery API, which must be loaded prior to the script.
The cardNumber field is designed to collect a card number, including an icon used to display the
card type. The field will only accept digits and spaces and validate that any entered value is a
correctly formatted card number and insert spaces at the correct positions for the card type as the
number is typed.
The cardCVV field is designed to collect a card CVV. The field will only accept digits and will
validate that any entered value is a correctly formatted CVV, taking into account the card type as
determined by an associated cardNumber field.
The cardExpiryDate and cardStartDate fields are designed to collect a card expiry date and card
issue date respectively. The fields can render as a pair of select controls containing the months
and a suitable range of years; or as an input control that will only allow digits to be entered and
automatically formatted as a month / year entry. The field will validate that any entered value is a
valid month and year combination.
The cardIssueNumber field is designed to collect a card issue number. The field will only accept
digits and will validate that any entered value is a correctly formatted issue number.
- 289 -
GATEWAY
INTEGRATION GUIDE
The cardDetails field is designed to collect all of the essential card details. It combines the
cardNumber, cardExpiryDate and cardCVV fields into a single line compound field design to
allow easy entry of the card details and to complement the look of your checkout.
These hosted fields can be used on your payment form alongside any standard HTML form fields,
for example, any collecting the Cardholder’s billing or delivery addresses and any other order
information you require.
The field type is either: passed as the value of the type option the Field construction, provided by
the HTML element’s meta data; or provided via the HTML element’s type attribute (prefixed with
the ‘hostedfield:’ name space).
The following example shows all three approaches to specifying the field type:
1. <input type="hostedfield:cardNumber" name="card-number">
2. <div class="hostedfield" data-hostedfield-type="cardExpiryDate"></div>
3. <input data-hostedfield='{"type":"cardCVV"}'>
It is highly recommended that you adopt a single approach as above and don’t mix and match.
Each field type has its own additional configuration options, as detailed in section A-21.3.6.
V2.00
- 290 -
GATEWAY
INTEGRATION GUIDE
Form(element, options)
The element parameter should be the DOM node of an existing FORM tag.
The options parameter should be object containing one of more of the following optional
properties:
• autoSetup – boolean indicating whether setup should be handled automatically.
• autoSubmit – boolean indicating whether submission should be handled automatically.
• merchantID – string containing the merchantID the payment request is for.
• stylesheet – string containing DOM selector for any stylesheets to be used.
• tokenise – string/array/object specifying fields whose values should be tokenised.
• fields – object containing field configuration by field type.
• locale – string containing the desired locale.
• classes – object containing names of extra CSS classes to use.
• submitOnEnter – boolean indicating whether the enter key should cause the form to submit.
• nativeEvents – boolean indicating that native browser events should be fired.
Any options parameter will be merged with those provided via meta data supplied, using data-
hostedfield and/or data-hostedfield-<option> attributes; or via existing attributes or
properties of the element.
The autoSetup option can be used to disable the automatic creation of Field objects for the
FORM child controls by calling the autoSetup() method during the Form construction. If
automatic setup is disabled, then you must manually instantiate Field objects and attach them to
the Form as required, using the addField() method. This option or manually calling the
autoSetup() method minimises the amount of JavaScript you have to write. Automatic operation
is good if you don’t need to customise the operation or can’t customise it by reacting to the Form or
Field events. The option defaults to true and cannot be changed once the Form has been
created.
The autoSubmit option can be used to disable the automatic handling of the FORM submission
via the autoSubmit() method. If automatic submission is disabled, then you must manually
retrieve the sensitive payment details by calling getPaymentDetails() and include them in the
form submission data. This option or manually calling the autoSubmit() method minimises the
amount of JavaScript you have to write. Automatic operation is good if you don’t need to
customise the operation or can’t customise it by reacting to the Form or Field events. The option
defaults to true and cannot be changed once the Form has been created.
The merchantID option can be used to specify the merchantID with which the final
paymentToken will be used. The option defaults to the value of any child INPUT node whose
name is ‘merchantID’ and can be changed at runtime by calling the setMerchantID() method or
by altering the options using the jQuery hostedForm() plugin method.
The stylesheet option can be used to specify a DOM selector used to locate stylesheets that
should be parsed for styles related to the Hosted Payment Fields. Refer to section A-21.3.10 for
V2.00
- 291 -
GATEWAY
INTEGRATION GUIDE
how to style the Hosted Payment Fields using CSS stylesheets. The option defaults to the DOM
selector string ‘link.hostedfield[rel=stylesheet], style.hostedfield' and can be changed at runtime by
calling the setStylesheet() method; or by altering the options using the jQuery hostedForm()
plugin method.
The tokenise option can be used to specify addition FORM controls whose values, as returned
by the jQuery.val() method, should be included in the final paymentToken.
The option’s value must be either:
• A string containing a DOM selector used to select one or more controls.
• An array containing values used to jQuery.filter() down to one or more controls.
• An object whose properties are the name of fields to tokenise and whose values are objects
containing a selector property used to select a control.
For the first two, the tokenised field’s name will be taken from the controls data-hostedfield-
tokenise attribute or name attribute. For the third, the name is property name in the tokenise
object. If the field’s name is of the format ‘paymentToken[<name>]’, then only the ‘<name>’ part is
used. The option defaults to the DOM selector string 'INPUT.hostedfield-tokenise:not(:disabled),
INPUT[data-hostedfield-tokenise]:not(:disabled), INPUT[name^="paymentToken["]:not(:disabled)'
and cannot be changed once the Form has been created.
The fields options can be used to specify default options for the different types of Hosted
Payment Fields. The option’s value should be an object whose properties are the fields type or the
wildcard type ‘any’ and whose values are objects whose properties are the default options for
fields of that type. The values can also contain a selector property containing a DOM selector
that is used during the automatic setup stage to select a FORM’s child element to add as a Field
of the specified type automatically. The option has no default value and cannot be changed once
the Form has been created.
The locale option can be used to specify the language that should be used by the Hosted
Payment Fields attached to this Form. The option defaults to the value provided by any lang
attribute on the element or closest ancestor and cannot be changed once the Form has been
created.
The classes options can be used to specify additional CSS class names to add in addition to the
default classes documented in section A-21.3.9. The value is an object whose properties are the
default class name and whose values are a string containing the additional class name(s) to use.
The option has no default and cannot be changed once the Form has been created.
The submitOnEnter option can be used to specify if pressing the enter key when typing a Field
value should cause the Form to submit. The option defaults to false and cannot be changed once
the Form has been created.
The nativeEvents option can be used to specify that any associated native event should be fired
when a ‘hostedField:’ prefixed Field event is fired (as documented in section A-21.3.8). For
example, when enabled if the ‘hostedfield:mouseover’ event is fired, then the native ‘mouseover’
event is also fired. The option defaults to false and cannot be changed once the Form has been
created.
V2.00
- 292 -
GATEWAY
INTEGRATION GUIDE
If not explicitly constructed, a Form object will be automatically instantiated and attached to the
FORM DOM node as soon as any Field object is instantiated on a child DOM node.
1. <form data-hostedfields='{"autoSetup":true,"autoSubmit":true,"tokenise":".add-to-
token","stylesheets":"#hostedfield-
stylesheet","fields":{"any":{"nativeEvents":true},"cardNumber":{"selector":"#form2-card-
number","stylesheet":"style.hostedform, style.hostedform-card-
number"}},"classes":{"invalid":"error"}}' method="post" novalidate="novalidate" lang="en">
2. <script>
3. var form = new window.hostedFields.classes.Form{document.forms[0]);
4. </script>
V2.00
- 293 -
GATEWAY
INTEGRATION GUIDE
void autoSetup()
Automatically setup the form by scanning the Form element for child nodes to control as Hosted
Payment Fields. Child nodes are selected if they:
• have a type attribute with a hostedfield:<type> value (INPUT nodes only).
• have a data attribute with a hostedfield.<type> property.
• match a DOM selector provided by the fields.<type>.selector option.
If multiple selection criteria are present, then they must all specify the same Field type or an
exception is thrown.
This method is called during the Form construction unless the autoSetup option is false.
void autoSubmit()
Automatically handles any attempted FORM submission by checking the FORM’s controls are
valid by calling the validate() method; and then requesting the paymentToken using the
getPaymentDetails() method; and finally adding the token to the forms fields using the
addPaymentToken() method. Failure to validate or request the payment token will cause the
form submission to be stopped.
You can affect the automatic submission stages by listening for events and preventing their
default actions. The full list of events is documented in section A-21.3.5.
This method is attached to the FORM submit event during the Form construction unless the
autoSubmit option is false, or the autoSubmit option is null and the autoSetup option is false.
If automatic submission is disabled, then you must react to the FORM’s submit event and then
request the paymentToken using the getPaymentDetails() method and ensure that the
token is sent as part of the form’s data.
boolean addField(Field f)
boolean delField(Field f)
Validate all Field values on the Form, either during submission or not.
- 294 -
GATEWAY
INTEGRATION GUIDE
object[] getInvalidElements()
Get details about all invalid FORM controls (not just invalid hosted Field elements).
object getValidationErrors()
Get the validation errors for all invalid FORM controls (not just invalid hosted Field elements).
Returns an object whose properties are the associated labels, names or id of the invalid FORM
controls and whose values are the error message for that control.
Gets the payment details, generating a paymentToken containing the hosted Field values; any
values specified by the tokenise option; and any passed tokenData. The Form will be
validated first if required.
Returns a promise that will be resolved when the payment details have been obtained, passing
the details as an object containing the following properties:
• success – boolean true if successful, false otherwise.
• message – string containing message to display if not successful.
• errors – object containing details about invalid payment data.
• invalid – object as returned by getValidationErrors() method.
• paymentToken – string containing generated paymentToken.
Add the payment token as the value of a Form child INPUT whose name is ‘paymentToken’,
creating the control if needed. Any created control will be given a type of ‘hidden’.
Set the DOM selector used to select the stylesheet(s) used by the Form.
V2.00
- 295 -
GATEWAY
INTEGRATION GUIDE
Get any default field options specified via the fields option, resulting from the merger of its
optional any and <type> properties.
void forceSubmit()
Forcefully submit the FORM element as if a child submit button had been clicked.
void reset()
Reset all the Form, setting all Field values back to their initial values.
void destroy()
Destroys the Form, reverting its element back to its original state.
V2.00
- 296 -
GATEWAY
INTEGRATION GUIDE
presubmit Fired by the autoSubmit() method prior to handling the submission. You can
prevent the handling of the submission and handle it yourself by calling the
Events preventDefault() method.
valid Fired by the autoSubmit() method if the FORM contains valid data prior to
requesting the payment details. You can prevent the continued handling of the
submission and handle it yourself by calling the Events preventDefault()
method or by invalidating the FORM.
submit-invalid Fired by the autoSubmit() method if the FORM contains invalid data prior to
displaying the validity using the DOM reportValidity() method. You can
prevent the reportValidity() call and display the validity yourself by calling the
Events preventDefault() method.
submit Fired by the autoSubmit() method prior to submitting the FORM. You can
prevent the FORM from submitting by calling the Events preventDefault()
method.
1 Event names are prefixed with the ‘hostedform:’ namespace not shown in the table.
The presubmit, valid, submit-invalid, submit and error events fired by the autoSubmit()
method the payload is an object with the following properties:
• success – boolean false.
• message – error message if error otherwise null.
• invalid – result of getValidationErrors() method if Form invalid.
• submitting – boolean true.
V2.00
- 297 -
GATEWAY
INTEGRATION GUIDE
Field(element, options)
The element parameter should be the DOM node of an existing INPUT or DIV tag.
The options parameter should be object containing one of more of the following optional
properties:
• type – string containing the desired field type.
• value – string containing the initial value.
• placeholder – string containing any placeholder text.
• style – string containing any inline CSS styles.
• stylesheet – string containing DOM selector for any stylesheets to be used.
• disabled – boolean indicating if initially disabled.
• required – boolean indicating if the value is required.
• readOnly – boolean indicating if initially read only.
• validity – boolean or string indicating the initial validity.
• locale – string containing the desired locale.
• classes – object containing names of extra CSS classes to use.
• submitOnEnter – boolean indicating if the enter key should cause the form to submit.
• nativeEvents – boolean indicating that native browser events should be fired.
• validationMessages – object containing alternative validation messages.
o required – string containing validation message to use when a value is required.
o invalid – string containing validation message to use when a value is invalid.
• format – string containing select option format for date fields.
• minYear – integer containing minimum year (relative to current year) for date fields.
• maxYear – integer containing maximum year (relative to current year) for date fields.
Any options parameter will be merged with those provided via meta data supplied using data-
hostedfield and/or data-hostedfield-<option> attributes, or via existing attributes or
properties of the element or provided via the getDefaultOptions() method of the parent Form.
The type option can be used to specify the type of Hosted Payment Field required. It defaults to
the value provided by any type attribute on the element (prefixed with the ‘hostedfield:’
namespace). The option cannot be changed once the Field has been created. Valid types are
cardDetails, cardNumber, cardCVV, cardExpiryDate, cardStartDate, cardIssueNumber.
The value option can be used to specify any initial value that should be used by the Field. It
defaults to the value provided by any value attribute or property on the element. Obviously, due
to the purpose of the Hosted Payment Fields, any initial value is not wise for card number and
CVV fields. The option can be changed at runtime by calling the setValue() method.
V2.00
- 298 -
GATEWAY
INTEGRATION GUIDE
The placeholder option can be used to specify any initial text that should be used as a
placeholder by the Field. It defaults to the value provided by any placeholder attribute or
property on the element. When used with the CardDetails type Field the placeholder contains
three parts separated by a pipe character, the first part contains the cardNumber placeholder, the
second part contains the cardExpiry placeholder, and the third part contains the cardCVV
placeholder. The option can be changed at runtime by calling the setPlaceholder() method or
by altering the options using the jQuery hostedForm() plugin method.
The style option can be used to specify any initial inline CSS style that should be used by the
Field. It defaults to the value provided by any style attribute or property on the element. The
option can be changed at runtime by calling the setStyle() method or by altering the options
using the jQuery hostedForm() plugin method.
The stylesheet option can be used to specify a DOM selector used to locate stylesheets that
should be parsed for styles related to this Field. Refer to section on styling fields. The option can
be changed at runtime by calling the setStylesheet() method or by altering the options using
the jQuery hostedForm() plugin method.
The disabled option can be used to specify if the Field should be initially disabled. It defaults to
the value provided by any disabled attribute or property on the element. The option can be
changed at runtime by calling the setDisabled() method or by altering the options using the
jQuery hostedForm() plugin method.
The required option can be used to specify if the Field value is required. It defaults to the value
provided by any required attribute or property on the element. The option can be changed at
runtime by calling the setRequired() method or by altering the options using the jQuery
hostedForm() plugin method.
The readOnly option can be used to specify if the Field should be initially read-only. It defaults to
the value provided by any readOnly attribute or property on the element. The option can be
changed at runtime by calling the setReadOnly() method or by altering the options using the
jQuery hostedForm() plugin method.
The validity option can be used to specify if the Field should be initially marked as invalid. It
defaults to the value provided by any validity property on the element. The option can be
changed at runtime by calling the setValidity() method or by altering the options using the
jQuery hostedForm() plugin method.
The locale option can be used to specify the language that should be used by the Field. It
defaults to the value provided by any lang attribute or property on the element or closest
ancestor. The option cannot be changed once the Field has been created.
The classes options can be used to specify additional CSS class names to add in addition to the
default classes documented in section A-21.3.9. The value is an object whose properties are the
default class name and whose values are a string containing the additional class name(s) to use.
This option will be merged with any classes option provided to the Form constructor. The option
cannot be changed once the Form has been created.
V2.00
- 299 -
GATEWAY
INTEGRATION GUIDE
The submitOnEnter option can be used to specify if pressing the enter key when typing the
Field value should cause the Form to submit. The option defaults to false and cannot be changed
once the Field has been created.
The nativeEvents option can be used to specify that any associated native event should be fired
when a ‘hostedfield:’ prefixed event is fired. Events are documented in section A-21.3.8. For
example, when enabled if the ‘hostedfield:mouseover’ event is fired then the native ‘mouseover’
event is also fired. The option defaults to false and cannot be changed once the Field has been
created.
The validationMessages option can be used to specify alternative validation messages that
should be displayed when a value is required or invalid. The option defaults to suitable messages
depending on the locale and cannot be changed once the Field has been created.
The dropdown option can be used to specify that a cardStartDate or cardExpiryDate Field
should be displayed as a pair of select controls to select the month and year, otherwise the month
and year are entered via a formatted input box instead. The option defaults to false and cannot be
changed once the Field has been created.
The format option can be used in conjunction with the dropdown option to specify the format used
to display the month and year in the dropdowns. The month and year parts of the format are
separated by a pipe character. The option defaults to ‘N – M | Y’ (eg ‘01 – January | 2020’) and
cannot be changed once the Field has been created.
The minYear and maxYear options can be used in conjunction with the dropdown option to specify
the minimum and maximum years that are included in the year dropdown. The option defaults to
minus 20 to zero for a cardStartDate Field or zero to plus 20 for a cardExpiryDate Field and
cannot be changed once the Field has been created.
V2.00
- 300 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 301 -
GATEWAY
INTEGRATION GUIDE
promise validate()
Validate the Field value. This will normally be called automatically when the Field loses focus
or the form is submitted, or when an invalid value is modified.
boolean isEmpty()
boolean isComplete()
Check if the Field has a complete, but not necessarily valid, value. This is mainly used by
compound fields such as cardDetails, cardExpiryDate, cardStartDate, which contain multiple
input controls and are deemed complete when all their required input controls have values.
Sets or gets the DOM selector used to select the stylesheet(s) used by the Field. When
setting, the stylesheets are parsed and applied to the Field.
V2.00
- 302 -
GATEWAY
INTEGRATION GUIDE
Sets or gets the placeholder text to be shown when the Field has no value.
When used with the CardDetails type Field the placeholder contains three parts separated by
a pipe character, the first part contains the cardNumber placeholder, the second part contains
the cardExpiry placeholder, and the third part contains the cardCVV placeholder.
Sets or gets the disabled state of the Field. When disabled, the field will be greyed out and not
be focusable and thus will not react to any input events.
A disabled Field will have the ‘hf-disabled’ class added otherwise the ‘hf-enabled’ class is
added.
Returns void when setting, or a boolean representing the state when getting.
Sets or gets the required state of the Field. When required, the field will be invalid if it contains
no value or a blank value.
A required Field will have the ‘hf-required’ class added otherwise the ‘hf-optional’ class is
added.
Returns void when setting, or a boolean representing the state when getting.
Sets or gets the read-only state of the Field. When read-only, the field will be not be focusable
and thus will not react to any input events.
A read-only Field will have the ‘hf-readonly’ class added otherwise the ‘hf-readwrite’ class is
added.
Returns void when setting, or a boolean representing the state when getting.
V2.00
- 303 -
GATEWAY
INTEGRATION GUIDE
Moves the browser’s focus to the Field. When focused, the field will react input events.
A focused Field will have the ‘hf-focus’ class added otherwise the ‘hf-blur’ class is added.
Returns void when setting, or a boolean representing the state when getting.
Sets or gets the validity of the Field. When valid, the validity will be true or a blank string.
When invalid, the validity will be an error message explaining the reason the value is invalid.
When used with the CardDetails type Field the error message contains three parts separated
by a pipe character, the first part contains the cardNumber value, the second part contains the
cardExpiry value, and the third part contains the cardCVV value.
A valid Field will have the ‘hf-valid’ and ‘hf-user-valid’ classes added otherwise the ‘hf-invalid’
and ‘hf-user-invalid’ classes are added.
Set or gets the Field value. Because Hosted Payment Fields are designed for the entry of
sensitive payment details, then these methods are not normally used. There is no means to
retrieve the actual sensitive data and so any returned value will be an empty string if the field
has no value or a single asterisk if the field has a value.
When used with the CardDetails type Field the value contains three parts separated by a pipe
character, the first part contains the cardNumber value, the second part contains the
cardExpiry value, and the third part contains the cardCVV value.
V2.00
- 304 -
GATEWAY
INTEGRATION GUIDE
void getState()
Get the current state of the Field as an object with the following boolean properties:
• isReady – the Field has been created, initialised and is ready for use.
• isValid – the value is valid (refer to the setValidity() method).
• isEmpty – the value is empty (refer to the isEmpty() method).
• isComplete – the value is complete (refer to the isComplete() method).
• isDisabled – the value is complete (refer to the setDisabled() method).
• isRequired – the value is complete (refer to the setRequired() method).
• isReadOnly – the value is complete (refer to the setReadOnly() method).
void reset()
void destroy()
Destroys the Form, reverting its element back to its original state.
Note: A field’s options or properties cannot be changed while a field is initialising, that is between
construction and firing of the ‘ready’ event. Attempts to change field options or properties before
this will be ignored.
V2.00
- 305 -
GATEWAY
INTEGRATION GUIDE
ready Fired when a Field style is has finished initialising and is ready.
autofill Fired when a Field has a value auto filled by the browser.
valid Fired when a Field is checked for validity and passes the check.
invalid Fired when a Field is checked for validity and fails the check.
uservalid Fired when the valid event is fired but only after user interaction has occurred,
such as focusing a Field, leaving a Field or attempting to submit a Form.
userinvalid Fired when the invalid event is fired but only after user interaction has occurred,
such as focusing a Field, leaving a Field or attempting to submit a Form.
V2.00
- 306 -
GATEWAY
INTEGRATION GUIDE
keypress Fired when a key except Shift, Fn, CapsLock is in a pressed position in a Field.
change Fired when an alteration to the value of a Field is committed by the user.
1 Event names are prefixed with the ‘hostedfield:’ namespace not shown in the table.
V2.00
- 307 -
GATEWAY
INTEGRATION GUIDE
hf-autofill Present when the value was auto filled by the browser.
hf-user-invalid Present when in the invalid state and user interaction has occurred, such as
focusing a Field, leaving a Field or attempting to submit a Form.
hf-user-valid Present when in the valid state and user interaction has occurred, such as
focusing a Field, leaving a Field or attempting to submit a Form.
In addition to these class names, the Field will add any corresponding class names provided by
the classes option provided when the Field is constructed.
For example, if the Field is constructed with a classes option as follows ‘{disabled: ‘text-
blur text-grey’, enabled: ‘text-normal’}’, then the ‘text-blur’ and ‘text-grey’ class names
will be present whenever the ‘hf-disabled’ class is present and the ‘text-normal’ class name will be
present whenever the ‘hf-enabled’ class name is present.
V2.00
- 308 -
GATEWAY
INTEGRATION GUIDE
However, styles have to be transferred from your website to the controls served from our website,
therefore styles must be isolated and easily identifiable. To aid with identification, all styles
intended for a Field must contain the ‘hostedfield’ class name in their selector or ‘-hostedfield’
extension on any id in the selector.
As a website may contain lots of stylesheets, a Field cannot be expected to parse every
stylesheet present on the page and therefore it only parses those selected using the stylesheets
construction option or using the setStylesheet() method. By default, this is any stylesheet
referenced via a <link> tag or <style> tag with the ‘hostedfield’ class name: ie any HTML node that
matches the following DOM selector ‘link.hostedfield[rel=stylesheet], style.hostedfield'.
CSS styles using the Field state classes, pseudo classes and pseudo elements are supported as
follows:
• :focus • .hf-user-valid • :placeholder-shown
• .hf-focus • :user-invalid • .hf-placeholder-shown
• :hover • .hf-user-invalid • :readonly
• .hf-hover • :required • .hf-readonly
• :enabled • .hf-required • :readwrite
• .hf-enabled • :optional • .hf-readwrite
• :disabled • .hf-optional • :-webkit-auto-fill
• .hf-disabled • :empty • .hf-icon
• :valid • .hf-empty • ::placeholder
• .hf-valid • :complete • ::-moz-placeholder
• :invalid • .hf-complete • ::-webkit-input-placeholder
• .hf-invalid • :autofill • ::-ms-input-placeholder
• :user-valid • .hf-autofill
The styles can contain any valid CSS rules and will be used to style both the public elements and
internal private elements. For security only, styles that relate to the textual representation of the
Field are passed to the internal private elements. This includes styles such as colours, font
weights and text decorations. At present, it is not possible to specify custom fonts as they would
require the font files to be available on our servers.
The following styles can be used to style the Field internal private elements:
• caret-color • font-size • font-variant-numeric
• color • font-size-adjust • font-variant-position
• cursor • font-smooth • font-weight
• direction • font-stretch • letter-spacing
• fill • font-style • line-height
• filter • font-synthesis • stroke
• font • font-variant • text-align
• font-family • font-variant-alternates • text-decoration
• font-feature-settings • font-variant-caps • text-decoration-color
• font-kerning • font-variant-east-asian • text-decoration-line
• font-language-override • font-variant-ligatures • text-decoration-style
V2.00
- 309 -
GATEWAY
INTEGRATION GUIDE
The ‘.hf-icon’ class name can be used to target the icon sub element in a cardDetails Field.
Individual controls can be targeted by using DOM ids, which will have a ‘-hostedfield’ extension
added to the DOM id of the original element.
It is advisable to keep CSS selectors and rules as simple as possible to avoid styling errors
caused by a failure to parse and filter the rules.
The following list are the best web safe fonts for use with any ‘font’ or ‘font-family’ style as these
fonts should be available on most web browsers:
• Arial (sans-serif)
• Verdana (sans-serif)
• Helvetica (sans-serif)
• Tahoma (sans-serif)
• Trebuchet MS (sans-serif)
• Times New Roman (serif)
• Georgia (serif)
• Garamond (serif)
• Courier New (monospace)
• Brush Script MT (cursive)
V2.00
- 310 -
GATEWAY
INTEGRATION GUIDE
Example stylesheet:
1. <style class="hostedfield">
2. /*
3. * Style hosted field internals
4. * - only accept font, foreground and background styling
5. */
6.
7. /* Copy of Bootstrap styles */
8. .hostedfield:disabled {
9. cursor: not-allowed;
10. background-color: #eee;
11. opacity: 1;
12. }
13.
14. /* Change text to red when invalid */
15. .form-control:invalid,
16. .hostedfield:invalid {
17. border-color: #a94442 !important;
18. color: #a94442 !important;
19. }
20.
21. /* Change text to light grey when readonly */
22. .form-control:readonly,
23. .hostedfield:readonly {
24. color: lightgrey !important;
25. }
26.
27. /* Emulate webkit auto fill style */
28. .form-control.hf-autofill,
29. .hostedfield.hf-autofill {
30. background-color: rgb(250, 255, 189) !important;
31. background-image: none !important;
32. color: rgb(0, 0, 0) !important;
33. }
34.
35. /* Add pink placeholder */
36. .form-control::placeholder,
37. .hostedfield::placeholder {
38. color: pink;
39. }
40.
41. /* Show hovering over the control */
42. .form-control.hf-hover,
43. .hostedfield.hf-hover {
44. font-style: italic;
45. }
46.
47. /* Style by id (hosted field will have '-hostedfield' appended to the id) */
48. #form1-card-details.hostedfield, #form1-card-details-hostedfield {
49. color: blue;
50. }
51.
52. </style>
V2.00
- 311 -
GATEWAY
INTEGRATION GUIDE
$(element).hostedForm(options);
$(element).hostedForm(‘instance’);
$(element).hostedForm(‘options’, options);
$(element).hostedForm(method, parameters);
$(element).hostedForm(‘destroy’);
$(element).hostedField(options);
$(element).hostedField(‘instance’);
$(element).hostedField(‘options’, options);
$(element).hostedField(method, parameters);
$(element).hostedField(‘destroy’);
The script will also add a ‘:hostedfield’ pseudo selector allowing Field elements to be selected
using the following example notation:
$(‘INPUT:hostedfield’)
V2.00
- 312 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 313 -
GATEWAY
INTEGRATION GUIDE
1. HTTP/1.1 200 OK
2. POST /hosted/ HTTP/1.1
3. Host: gateway.example.com
4. Accept: */*
5. Content-Length: 314
6. Content-Type: application/x-www-form-urlencoded
7.
8. merchantID=100001&action=SALE&type=1¤cyCode=826&countryCode=826&amount=680&transactionUnique=5de651c7c537
9&orderRef=Test+Transaction&redirectURL=https%3A%2F%2Fptop.only.wip.la%3A443%2Fhttps%2Fmyshop.com&signature=ba12b0766a3412782448f154be15e8f61eea
390387b1b23d4688c82c9f28f81df593de5890426546cca365943cc7b5c4897c9721b663a0e17680e1e796f1ad55
1. HTTP/1.1 200 OK
2. Date: Tue, 01 Jan 2019 09:30:45 GMT
3. Server: Apache/2.4.23 (Win64) OpenSSL/1.0.2k-fips PHP/5.4.12
4. Vary: Host
5. X-Powered-By: PHP/5.4.12
6. Expires: Thu, 19 Nov 1981 08:52:00 GMT
7. Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
8. Pragma: no-cache
9. Content-Length: 4129
10. Content-Type: text/html
11.
12. <!DOCTYPE html>
13. <html>
14. --- Hosted Payment Page HTML Removed ---
15. </html>
V2.00
- 314 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 315 -
GATEWAY
INTEGRATION GUIDE
1. HTTP/1.1 200 OK
2. Date: Tue, 01 Jan 2019 09:30:45 GMT
3. Server: Apache/2.4.23 (Win64) OpenSSL/1.0.2k-fips PHP/5.4.12
4. Vary: Host
5. X-Powered-By: PHP/5.4.12
6. Content-Length: 2449
7. Content-Type: text/html
8.
9. merchantID=100001&threeDSEnabled=Y&avscv2CheckEnabled=Y&riskCheckEnabled=N&caEnabled=Y&rtsEnabled=Y&cftEnabled=
Y&threeDSCheckPref=not+known%2Cnot+checked%2Cauthenticated%2Cattempted+authentication&cv2CheckPref=matched&addr
essCheckPref=not+known%2Cnot+checked%2Cmatched%2Cpartially+matched&postcodeCheckPref=not+known%2Cnot+checked%2C
matched%2Cpartially+matched&cardCVVMandatory=Y&riskCheckPref=not+known%3Dfinished%2Cnot+checked%3Ddecline2%2Cap
prove%3Dcontinue%2Cdecline%3Ddecline1%2Creview%3Ddecline2%2Cescalate%3Dfinished¬ifyEmail=an.operator%40merch
ant.com&customerReceiptsRequired=Y&merchantCategoryCode=6013&surchargeEnabled=Y&surchargeRequired=N&surchargeRu
les%5B0%5D%5BcardType%5D=CC&surchargeRules%5B0%5D%5Bsurcharge%5D=10.1235&surchargeRules%5B1%5D%5BcardType%5D=CC
&surchargeRules%5B1%5D%5Bcurrency%5D=GBP&surchargeRules%5B1%5D%5Bsurcharge%5D=2.5000&surchargeRules%5B2%5D%5Bca
rdType%5D=VC&surchargeRules%5B2%5D%5Bsurcharge%5D=3.5000&surchargeRules%5B3%5D%5BcardType%5D=VC&surchargeRules%
5B3%5D%5Bcurrency%5D=GBP&surchargeRules%5B3%5D%5Bsurcharge%5D=4.5000&surchargeRules%5B4%5D%5BcardType%5D=DD&sur
chargeRules%5B4%5D%5Bsurcharge%5D=5.5000&action=SALE&type=1¤cyCode=826&countryCode=826&amount=680&transactionUn
ique=5de65b552499e&orderRef=Test+Transaction&cardExpiryDate=1219&threeDSRequired=N&avscv2CheckRequired=N&duplic
ateDelay=0&requestID=5de65b562496f&responseCode=0&responseMessage=AUTHCODE%3A347414&state=captured&requestMerch
antID=100001&processMerchantID=100001&paymentMethod=card&cardType=Visa+Credit&cardTypeCode=VC&cardScheme=Visa+&
cardSchemeCode=VC&cardIssuer=BARCLAYS+BANK+PLC&cardIssuerCountry=United+Kingdom&cardIssuerCountryCode=GBR&cardF
lags=8323072&cardNumberMask=492942%2A%2A%2A%2A%2A%2A0821&cardNumberValid=Y&xref=19120312NG55CM51QH35JRL&cardExp
iryMonth=12&cardExpiryYear=19&authorisationCode=347414&transactionID=10018201&responseStatus=0×tamp=2019-12-
03+12%3A55%3A52&amountApproved=680&amountReceived=680&amountRetained=680&avscv2ResponseCode=244100&avscv2Respon
seMessage=SECURITY+CODE+MATCH+ONLY&avscv2AuthEntity=merchant+host&cv2Check=matched&addressCheck=not+matched&pos
tcodeCheck=not+matched¬ifyEmailResponseCode=0¬ifyEmailResponseMessage=Email+successfully+queued&vcsRespon
seCode=0&vcsResponseMessage=Success+-
+no+velocity+check+rules+applied¤cyExponent=2&signature=e5c65e5d0340e0ec0de8782affcb6caba2e4d202a6873a167
7ddbf6415cb1dd52cc597e43c758b233afd121367d300a57d0faade7abf6b4b88a1a1b974e55d33
V2.00
- 316 -
GATEWAY
INTEGRATION GUIDE
The following HTTP headers are sent on each individual part request:
V2.00
- 317 -
GATEWAY
INTEGRATION GUIDE
This reference number is used to request information about the status of a batch via
HTTP GET requests to the URL endpoint as outlined in section 1.3.3.
x-p3-token If user authentication was sent in the initial request, this header will contain a token
that can be used for future requests for the status of the batch instead of having to
use a username/password.
content-type Content type of the HTTP batch request. This will be ‘multipart/mixed’ and contain a
boundary parameter to separate each transaction request.
The following HTTP headers are received on each individual part response:
V2.00
- 318 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 319 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 320 -
GATEWAY
INTEGRATION GUIDE
- 321 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 322 -
GATEWAY
INTEGRATION GUIDE
1. <?PHP
2.
3. // Signature key entered on MMS. The demo account is fixed to this value,
4. $key = 'Circle4Take40Idea';
5.
6. // Gateway URL
7. $url = 'https://gateway.example.com/direct/';
8.
9. // Setup PHP session as use it to store data between 3DS steps
10. if (isset($_GET['sid'])) {
11. session_id($_GET['sid']);
12. }
13.
14. session_start();
15.
16. // Compose current page URL (removing any sid and acs parameters)
17. $pageUrl = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://')
18. . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '')
19. . preg_replace('/(sid=[^&]+&?)|(acs=1&?)/', '', $_SERVER['REQUEST_URI']);
20.
21. // Add back the correct sid parameter (used as session cookie may not be passed when the page is redirected fr
om an IFRAME)
22. $pageUrl .= (strpos($pageUrl, '?') === false ? '?' : '&') . 'sid=' . urlencode(session_id());
23.
24.
25. // If ACS response into the IFRAME then redirect back to parent window
26. if (!emptyempty($_GET['acs'])) {
27. echo silentPost($pageUrl, array('threeDSResponse' => $_POST), '_parent');
28. exit();
29. }
30.
31. if (!isset($_POST['threeDSResponse'])) {
32. // Initial request
33.
34. // Gather browser info - can be done at any time prior to the checkout
35. if (!isset($_POST['browserInfo'])) {
36. echo collectBrowserInfo();
37. exit();
38. }
39.
40. // Direct Request
41. $req = array(
42. 'merchantID' => 100001,
43. 'action' => 'SALE',
44. 'type' => 1,
45. 'currencyCode' => 826,
46. 'countryCode' => 826,
47. 'amount' => 1001,
48. 'cardNumber' => '4012001037141112',
49. 'cardExpiryMonth' => 12,
50. 'cardExpiryYear' => 15,
51. 'cardCVV' => '083',
52. 'customerName' => 'Test Customer',
53. 'customerEmail' => '[email protected]',
54. 'customerAddress' => '16 Test Street',
55. 'customerPostCode' => 'TE15 5ST',
56. 'orderRef' => 'Test purchase',
57.
58. // The following fields are mandatory for 3DS v2
V2.00
- 323 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 324 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 325 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 326 -
GATEWAY
INTEGRATION GUIDE
1. <?PHP
2.
3. // Signature key entered on MMS. The demo account is fixed to this value,
4. $key = 'Circle4Take40Idea';
5.
6. // Gateway URL
7. $url = 'https://gateway.example.com/direct/';
8.
9. // Request
10. $req = array(
11. 'merchantID' => '100001',
12. 'action' => 'SALE',
13. 'type' => 1,
14. 'countryCode' => 826,
15. 'currencyCode' => 826,
16. 'amount' => 1001,
17. 'cardNumber' => '4012001037141112',
18. 'cardExpiryMonth' => 12,
19. 'cardExpiryYear' => 15,
20. 'cardCVV' => '083',
21. 'customerName' => 'Test Customer',
22. 'customerEmail' => '[email protected]',
23. 'customerPhone' => '+44 (0) 123 45 67 890',
24. 'customerAddress' => '16 Test Street',
25. 'customerPostCode' => 'TE15 5ST',
26. 'orderRef' => 'Test purchase',
27. 'transactionUnique' => uniqid(),
28. );
29.
30. // Create the signature using the function called below.
31. $req['signature'] = createSignature($req, $key);
32.
33. // Initiate and set curl options to post to the gateway
34. $ch = curl_init($url);
35. curl_setopt($ch, CURLOPT_POST, true);
36. curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($req));
37. curl_setopt($ch, CURLOPT_HEADER, false);
38. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
39. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
40.
41. // Send the request and parse the response
42. parse_str(curl_exec($ch), $res);
43.
44. // Close the connection to the gateway
45. curl_close($ch);
46.
47. // Extract the return signature as this isn't hashed
48. $signature = null;
49. if (isset($res['signature'])) {
50. $signature = $res['signature'];
51. unset($res['signature']);
52. }
53.
54. // Check the return signature
55. if (!$signature || $signature !== createSignature($res, $key)) {
56. // You should exit gracefully
57. die('Sorry, the signature check failed');
58. }
59.
60. // Check the response code
61. if ($res['responseCode'] === "0") {
62. echo "<p>Thank you for your payment.</p>";
V2.00
- 327 -
GATEWAY
INTEGRATION GUIDE
63. } else {
64. echo "<p>Failed to take payment: " . htmlentities($res['responseMessage']) . "</p>";
65. }
66.
67. // Function to create a message signature
68. function createSignature(array $data, $key) {
69. // Sort by field name
70. ksort($data);
71.
72. // Create the URL encoded signature string
73. $ret = http_build_query($data, '', '&');
74.
75. // Normalise all line endings (CRNL|NLCR|NL|CR) to just NL (%0A)
76. $ret = str_replace(array('%0D%0A', '%0A%0D', '%0D'), '%0A', $ret);
77.
78. // Hash the signature string and the key together
79. return hash('SHA512', $ret . $key);
80. }
81.
82. ?>
V2.00
- 328 -
GATEWAY
INTEGRATION GUIDE
1. <?PHP
2.
3. // Signature key entered on MMS. The demo account is fixed to this value,
4. $key = 'Circle4Take40Idea';
5.
6. // Gateway URL
7. $url = 'https://gateway.example.com/batch/';
8.
9. // Create a unique multipart boundary
10. $boundary = uniqid();
11.
12. // Requests
13. $reqs = array(
14. array(
15. 'merchantID' => 100001,
16. 'action' => 'SALE',
17. 'type' => 1,
18. 'currencyCode' => 826,
19. 'countryCode' => 826,
20. 'amount' => 1001,
21. 'cardNumber' => '4012001037141112',
22. 'cardExpiryMonth' => 12,
23. 'cardExpiryYear' => 15,
24. 'cardCVV' => '083',
25. 'customerName' => 'Test Customer',
26. 'customerEmail' => '[email protected]',
27. 'customerAddress' => '16 Test Street',
28. 'customerPostCode' => 'TE15 5ST',
29. 'orderRef' => 'Test purchase',
30. 'transactionUnique' => uniqid(),
31. 'threeDSRequired' => 'N',
32. 'avscv2CheckRequired' => 'N',
33. ),
34. array(
35. 'merchantID' => 100001,
36. 'action' => 'SALE',
37. 'type' => 1,
38. 'currencyCode' => 826,
39. 'countryCode' => 826,
40. 'amount' => 2002,
41. 'cardNumber' => '4012001037141112',
42. 'cardExpiryMonth' => 12,
43. 'cardExpiryYear' => 15,
44. 'cardCVV' => '083',
45. 'customerName' => 'Test Customer',
46. 'customerEmail' => '[email protected]',
47. 'customerAddress' => '16 Test Street',
48. 'customerPostCode' => 'TE15 5ST',
49. 'orderRef' => 'Test purchase',
50. 'transactionUnique' => uniqid(),
51. 'threeDSRequired' => 'N',
52. 'avscv2CheckRequired' => 'N',
53. ),
54. array(
55. 'merchantID' => 100001,
56. 'action' => 'SALE',
57. 'type' => 1,
58. 'currencyCode' => 826,
59. 'countryCode' => 826,
V2.00
- 329 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 330 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 331 -
GATEWAY
INTEGRATION GUIDE
1. <?PHP
2. require('gateway.php');
3.
4. use \P3\SDK\Gateway;
5.
6. // Signature key entered on MMS. The demo account is fixed to this value,
7. Gateway::$merchantSecret = 'Circle4Take40Idea';
8.
9. // Gateway URL
10. Gateway::$hostedUrl = 'https://gateway.example.com/hosted/';
11.
12. if (!isset($_POST['responseCode'])) {
13. // Send request to gateway
14. $req = array(
15. 'merchantID' => 100001,
16. 'action' => 'SALE',
17. 'type' => 1,
18. 'currencyCode' => 826,
19. 'countryCode' => 826,
20. 'amount' => 1001,
21. 'orderRef' => 'Test purchase',
22. 'redirectURL' => ($_SERVER['HTTPS'] == 'on' ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . $_SER
VER['REQUEST_URI'],
23. );
24.
25. try {
26. echo Gateway::hostedRequest($req);
27. } catch (\Exception $e) {
28. // You should exit gracefully
29. die('Sorry, the request could not be sent: ' . $e);
30. }
31.
32. } else {
33. // Received response from gateway
34. try {
35. Gateway::verifyResponse($_POST);
36. } catch(\Exception $e) {
37. // You should exit gracefully
38. die('Sorry, the request could not be sent: ' . $e);
39. }
40.
41. // Check the response code
42. if ($_POST['responseCode'] === 0) {
43. echo "<p>Thank you for your payment.</p>";
44. } else {
45. echo "<p>Failed to take payment: " . htmlentities($_POST['responseMessage']) . "</p>";
46. }
47. }
48.
49. ?>
V2.00
- 332 -
GATEWAY
INTEGRATION GUIDE
1. <?PHP
2.
3. require('gateway.php');
4.
5. use \P3\SDK\Gateway;
6.
7. // Signature key entered on MMS. The demo account is fixed to this value,
8. Gateway::$merchantSecret = 'Circle4Take40Idea';
9.
10. // Gateway URL
11. Gateway::$directUrl = 'https://gateway.example.com/direct/';
12.
13. // Setup PHP session as use it to store data between 3DS steps
14. if (isset($_GET['sid'])) {
15. session_id($_GET['sid']);
16. }
17.
18. session_start();
19.
20. // Compose current page URL (removing any sid and acs parameters)
21. $pageUrl = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://')
22. . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '')
23. . preg_replace('/(sid=[^&]+&?)|(acs=1&?)/', '', $_SERVER['REQUEST_URI']);
24.
25. // Add back the correct sid parameter (used as session cookie may not be passed when the page is redirected fro
m an IFRAME)
26. $pageUrl .= (strpos($pageUrl, '?') === false ? '?' : '&') . 'sid=' . urlencode(session_id());
27.
28.
29. // If ACS response into the IFRAME then redirect back to parent window
30. if (!empty($_GET['acs'])) {
31. echo silentPost($pageUrl, array('threeDSResponse' => $_POST), '_parent');
32. exit();
33. }
34.
35. if (!isset($_POST['threeDSResponse'])) {
36. // Initial request
37.
38. // Gather browser info - can be done at any time prior to the checkout
39. if (!isset($_POST['browserInfo'])) {
40. echo Gateway::collectBrowserInfo();
41. exit();
42. }
43.
44. // Direct Request
45. $req = array(
46. 'merchantID' => 100001,
47. 'action' => 'SALE',
48. 'type' => 1,
49. 'currencyCode' => 826,
50. 'countryCode' => 826,
51. 'amount' => 1001,
52. 'cardNumber' => '4012001037141112',
53. 'cardExpiryMonth' => 12,
54. 'cardExpiryYear' => 15,
55. 'cardCVV' => '083',
56. 'customerName' => 'Test Customer',
57. 'customerEmail' => '[email protected]',
58. 'customerAddress' => '16 Test Street',
59. 'customerPostCode' => 'TE15 5ST',
60. 'orderRef' => 'Test purchase',
61.
V2.00
- 333 -
GATEWAY
INTEGRATION GUIDE
62.
63. // The following fields are mandatory for 3DS v2
64. 'remoteAddress' => $_SERVER['REMOTE_ADDR'],
65. 'threeDSRedirectURL' => $pageUrl . '&acs=1',
66.
67. // The following field allows options to be passed for 3DS v2
68. // and the values here are for demonstration purposes only
69. 'threeDSOptions' => array(
70. 'paymentAccountAge' => '20190601',
71. 'paymentAccountAgeIndicator' => '05',
72. ),
73. );
74.
75. // Add the browser info as it is mandatory for 3DS v2
76. $req += $_POST['browserInfo'];
77.
78. } else {
79. // 3DS continuation request
80. $req = array(
81. // The following field are only required for tbe benefit of the SDK
82. 'merchantID' => 100001,
83. 'action' => 'SALE',
84.
85. // The following field must be passed to continue the 3DS request
86. 'threeDSRef' => $_SESSION['threeDSRef'],
87. 'threeDSResponse' => $_POST['threeDSResponse'],
88. );
89.
90. }
91.
92.
93. try {
94. $res = Gateway::directRequest($req);
95. } catch (\Exception $e) {
96. // You should exit gracefully
97. die('Sorry, the request could not be sent: ' . $e);
98. }
99.
100. // Check the response code
101. if ($res['responseCode'] === Gateway::RC_3DS_AUTHENTICATION_REQUIRED) {
102. // Send request to the ACS server displaying response in an IFRAME
103.
104. // Render an IFRAME to show the ACS challenge (hidden for fingerprint method)
105. $style = (isset($res['threeDSRequest']['threeDSMethodData']) ? 'display: none;' : '');
106. echo "<iframe name=\"threeds_acs\" style=\"height:420px; width:420px; {$style}\"></iframe>\n";
107.
108. // Silently POST the 3DS request to the ACS in the IFRAME
109. echo silentPost($res['threeDSURL'], $res['threeDSRequest'], 'threeds_acs');
110.
111. // Remember the threeDSRef as need it when the ACS responds
112. $_SESSION['threeDSRef'] = $res['threeDSRef'];
113.
114. } else if ($res['responseCode'] === Gateway::RC_SUCCESS) {
115. echo "<p>Thank you for your payment.</p>";
116. } else {
117. echo "<p>Failed to take payment: " . htmlentities($res['responseMessage']) . "</p>";
118. }
119.
120.
121.
122. // Render HTML to silently POST data to URL in target brower window
123. function silentPost($url = '?', array $post = null, $target = '_self') {
124.
125. $url = htmlentities($url);
126. $target = htmlentities($target);
127. $fields = '';
128.
V2.00
- 334 -
GATEWAY
INTEGRATION GUIDE
129. if ($post) {
130. foreach ($post as $name => $value) {
131. $fields .= Gateway::fieldToHtml($name, $value);
132. }
133. }
134.
135. $ret = "
136. <form id=\"silentPost\" action=\"{$url}\" method=\"post\" target=\"{$target}\">
137. {$fields}
138. <noscript><input type=\"submit\" value=\"Continue\"></noscript
139. </form>
140. <script>
141. window.setTimeout('document.forms.silentPost.submit()', 0);
142. </script>
143. ";
144.
145. return $ret;
146. }
147.
148. ?>
V2.00
- 335 -
GATEWAY
INTEGRATION GUIDE
1. <html>
2. <head>
3. <!-- Load the Hosted Payment Page library -->
4. <script src="https://gateway.example.com/sdk/web/v1/js/hostedforms.min.js"></script>
5. </head>
6. <body>
7. <!--
8. Hosted Payment <form> as created by the Gateway Integration Library hostedRequest() method
9. with addition of 'data-hostedforms-modal' attribute to signify a modal form is required.
10. -->
11. <form name="payment-form" method="post" action="https://gateway.example.com/hosted/" data-hostedforms-
modal>
12. <input type="hidden" name="merchantID" value="100001" />
13. <input type="hidden" name="action" value="SALE" />
14. <input type="hidden" name="type" value="1" />
15. <input type="hidden" name="currencyCode" value="826" />
16. <input type="hidden" name="countryCode" value="826" />
17. <input type="hidden" name="amount" value="1001" />
18. <input type="hidden" name="orderRef" value="Test purchase" />
19. <input type="hidden" name="redirectURL" value="https://www.merchant.com/payment/" />
20. <input type="hidden" name="signature" value="07599ef4cdb2e26cb2bf34a9c65190a7ce82494bc1df144c3bb0d20ee265
5d8278dc663b2b0421ef12b8f081e821151bb4c644277c5d65b5523a96539b53b5aa" />
21. <input type="submit" value="Pay Now">
22. </form>
23. <script>
24. // Create a new Hosted Form object which will cause the above <form> to load into a modal
25. // overlay over this page.
26. var form = new window.hostedForms.classes.Form(document.forms[0]);
27. </script>
28. </body>
29. </html>
V2.00
- 336 -
GATEWAY
INTEGRATION GUIDE
1. <html>
2. <head>
3. <!-- Load the jQuery library -->
4. <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-
CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
5.
6. <!-- Load the Hosted Payment Page library -->
7. <script src="https://gateway.example.com/sdk/web/v1/js/hostedforms.min.js"></script>
8. </head>
9. <body>
10. <!--
11. Hosted Payment <form> as created by the Gateway Integration Library hostedRequest() method
12. with addition of 'data-hostedforms-modal' attribute to signify a modal form is required.
13. -->
14. <form name="payment-form" method="post" action="https://gateway.example.com/hosted/" data-hostedforms-
modal>
15. <input type="hidden" name="merchantID" value="100001" />
16. <input type="hidden" name="action" value="SALE" />
17. <input type="hidden" name="type" value="1" />
18. <input type="hidden" name="currencyCode" value="826" />
19. <input type="hidden" name="countryCode" value="826" />
20. <input type="hidden" name="amount" value="1001" />
21. <input type="hidden" name="orderRef" value="Test purchase" />
22. <input type="hidden" name="redirectURL" value="https://www.merchant.com/payment/" />
23. <input type="hidden" name="signature" value="07599ef4cdb2e26cb2bf34a9c65190a7ce82494bc1df144c3bb0d20ee265
5d8278dc663b2b0421ef12b8f081e821151bb4c644277c5d65b5523a96539b53b5aa" />
24. <input type="submit" value="Pay Now">
25. </form>
26. <script>
27. // Create a new Hosted Form object which will cause the above <form> to load into a modal
28. // overlay over this page.
29. var form = $(document.forms[0]).hostedForm();
30. </script>
31. </body>
32. </html>
V2.00
- 337 -
GATEWAY
INTEGRATION GUIDE
1. <html>
2. <head>
3. <!-- Load the Hosted Payment Page library -->
4. <script src="https://gateway.example.com/sdk/web/v1/js/hostedforms.min.js"></script>
5. </head>
6. <body>
7. <!— Pay button placeholder -->
8. <div id="paynow"></div>
9. <script>
10. // Create a new Hosted Form object which will render a payment button which will load
11. // the Hosted Payment Pageo load into a modal overlay over this page.
12.
13. // The request can be provided from your server.
14. var req = {
15. merchantID: '100001',
16. action: 'SALE',
17. type: '1',
18. currencyCode: '826',
19. countryCode: '826',
20. amount: '1001',
21. orderRef: 'Test purchase',
22. redirectURL: 'https://www.merchant.com/payment/',
23. signature: '07599ef4cdb2e26cb2bf34a9c65190a7ce82494bc1df144c3bb0d20ee2655d8278dc663b2b0421ef12b8f081e
821151bb4c644277c5d65b5523a96539b53b5aa',
24. };
25.
26. var data = {
27. id: 'my-payment-form',
28. url: 'https://gateway.example.com/hosted/modal/',
29. modal: true,
30. data: req,
31. submit: {
32. type: 'button',
33. label: 'Pay <i>Now</i>'
34. }
35. };
36.
37. var form = new window.hostedForms.classes.Form('paynow', data);
38. </script>
39. </body>
40. </html>
V2.00
- 338 -
GATEWAY
INTEGRATION GUIDE
1. <html>
2. <head>
3. <!-- Load the jQuery library -->
4. <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-
CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
5.
6. <!-- Load the Hosted Payment Page library -->
7. <script src="https://gateway.example.com/sdk/web/v1/js/hostedforms.min.js"></script>
8. </head>
9. <body>
10. <!— Pay button placeholder -->
11. <div id="paynow"></div>
12. <script>
13. // Create a new Hosted Form object which will render a payment button which will load
14. // the Hosted Payment Pageo load into a modal overlay over this page.
15.
16. // The request can be provided from your server.
17. var req = {
18. merchantID: '100001',
19. action: 'SALE',
20. type: '1',
21. currencyCode: '826',
22. countryCode: '826',
23. amount: '1001',
24. orderRef: 'Test purchase',
25. redirectURL: 'https://www.merchant.com/payment/',
26. signature: '07599ef4cdb2e26cb2bf34a9c65190a7ce82494bc1df144c3bb0d20ee2655d8278dc663b2b0421ef12b8f081e
821151bb4c644277c5d65b5523a96539b53b5aa',
27. };
28.
29. var data = {
30. id: 'my-payment-form',
31. url: 'https://gateway.example.com/hosted/modal/',
32. modal: true,
33. data: req,
34. submit: {
35. type: 'button',
36. label: 'Pay <i>Now</i>'
37. }
38. };
39.
40. var form = $('#paynow').hostedForm(data);
41. </script>
42. </body>
43. </html>
V2.00
- 339 -
GATEWAY
INTEGRATION GUIDE
The following example code shows how to create and manage Hosted Payment Fields using the
Hosted Payment Field library.
The example shows how to style fields using an inline stylesheet and how to listen and react to the
field’s events.
The example also shows how to set up the payment form both automatically and manually and
integrate with the jQuery validator plugin. You should choose the set-up method best suited for
your needs and whatever validation plugin or functions you are familiar with.
Note: The example code demonstrates including the static transaction information, such as the
merchantID and amount, in hidden form fields and POSTing the form directly to the Gateway’s
Direct Integration using partial message signing. We would however recommend that you capture
just the information you require and then POST this data to your own website where you can use it
to build a new fully signed request to send to the Gateway’s Direct Integration as a server-to-
server request.
1. <html>
2. <head>
3. <!-- Load the jQuery library -->
4. <script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-
CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
5.
6. <!-- Load the jQuery Validator plugin -->
7. <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.validate.min.js"></script>
8.
9. <!-- Load the Hosted Payment Field library -->
10. <script src="https://gateway.example.com/sdk/web/v1/js/hostedfields.min.js"></script>
11.
12. <!-- General styles -->
13. <style>
14. body {
15. font-size: 14px;
16. }
17.
18. .form-group {
19. margin: 4px 0 15px 0;
20. }
21.
22. .form-group LABEL {
23. display: inline-block;
24. max-width: 100%;
25. margin-bottom: 5px;
26. font-weight: bold;
27. }
28.
29. .form-control {
30. display: block;
31. box-sizing: border-box;
32. height: 34px;
33. width: 400px;
34. padding: 6px 12px;
35. font-size: 14px;
36. color: #555;
37. background-color: #fff;
38. background-image: none;
39. border: 1px solid #ccc;
40. border-radius: 4px;
41. -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
V2.00
- 340 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 341 -
GATEWAY
INTEGRATION GUIDE
109. }
110.
111. /* Style by id (hosted field will have '-hostedfield' appended to the id) */
112. #form-card-number, #form-card-number-hostedfield {
113. color: darkcyan;
114. }
115.
116. </style>
117.
118. <!-- Hosted Field card-number internal styles -->
119. <style class="card-number">
120.
121. .hostedfield::placeholder {
122. color: orange;
123. }
124.
125. </style>
126. </head>
127.
128. <body>
129. <!-- tokenise payment data and send directly to the Gateway -->
130. <form id="form" method="POST" novalidate="novalidate" lang="en"
131. action="https://gateway.example.com/direct/"
132. data-hostedform-tokenize='{"#form-customer-name": "customerName"}'>
133. <input type="hidden" name="merchantID" value="100001">
134. <input type="hidden" name="action" value="SALE">
135. <input type="hidden" name="type" value="1">
136. <input type="hidden" name="countryCode" value="826">
137. <input type="hidden" name="currencyCode" value="826">
138. <input type="hidden" name="amount" value="1001">
139. <input type="hidden" name="orderRef" value="Test purchase">
140. <input type="hidden" name="transactionUnique" value="1234">
141. <input type="hidden" name="redirectURL" value="https://www.merchant.com/payment/">
142. <input type="hidden" name="signature" value="5a0dd6fed71ef68bb3f20175b6a04bbd9d1c904d32ae3f160bd3b8f55740
207e5d1e8de5e7e9960b136407e7454b82e428b8378003aa0146df3efa91a3e61b17|merchantID,action,type,countryCode,currenc
yCode,amount,orderRef,transactionUnique,redirectURL">
143. <input type="hidden" name="paymentToken" value="">
144.
145. <div class="form-group">
146. <label for="form-customer-name">Name on card:</label>
147. <input id="form-customer-name" type="text" name="paymentToken[customerName]" autocomplete="cc-
name" class="form-control form-control-native hostedfield-tokenise" placeholder="Firstname Surname" required>
148. </div>
149.
150. <div class="form-group">
151. <label for="form-card-number">Card Number:</label>
152. <input id="form-card-number" type="hostedfield:cardNumber" name="card-number" autocomplete="cc-
number" class="form-control form-control-
hosted" style="background: #f2f8fb;" placeholder="**** **** **** ****" required>
153. </div>
154.
155. <div class="form-group">
156. <label for="form-card-expiry-date">Card Expiry Date:</label>
157. <input id="form-card-expiry-date" type="hostedfield:cardExpiryDate" name="card-expiry-
date" autocomplete="cc-exp" class="form-control form-control-hosted" required>
158. </div>
159.
160. <div class="form-group">
161. <label for="form-card-start-date">Card Issue Date:</label>
162. <input id="form-card-start-date" type="hostedfield:cardStartDate" name="card-start-
date" autocomplete="cc-iss" class="form-control form-control-hosted" data-hostedfield='{"dropdown":true}' data-
hostedfield-format="N - m | y" data-hostedfield-min-date="-40" data-hostedfeld-max-date="0">
163. </div>
164.
165. <div class="form-group">
166. <label for="form-card-cvv">CVV:</label>
V2.00
- 342 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 343 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 344 -
GATEWAY
INTEGRATION GUIDE
300. } else {
301. showError('There was a problem fetching the payment token. Please seek assistance.');
302. }
303. },
304.
305. // Failure either validating the form or requesting the payment details
306. function (e) {
307. showError('There was a problem fetching the payment token. Please seek assistance.');
308. }
309. );
310.
311. } catch (e) {
312. showError('There was a problem fetching the payment token. Please seek assistance.');
313. }
314. }
315. });
316.
317. // End of form manual setup
318.
319. }
320.
321. // Hide errors once all fields are valid
322. $('#form :input').on('valid', function () {
323. if ($(this.form).find(':invalid').length === 0) {
324. hideError($(this.form));
325. }
326. })
327.
328. // Listen for some events on the none Hosted Fields
329. $('.form-control-native').on('invalid', bsMarkInvalid);
330. $('.form-control-native').on('valid', bsMarkValid);
331.
332. // Check we can see the Hosted Fields via their new class
333. // (For demonstration purposes only)
334. console.log($('.form-control-hosted.hostedfield-element'));
335.
336. // Check we can see the Hosted Fields via the psuedo element
337. // (For demonstration purposes only)
338. console.log($('.form-control:hostedfield'));
339.
340. });
341.
342. ///////////////////////////////////////////////////////////////////
343. // Supporting functions
344. ///////////////////////////////////////////////////////////////////
345.
346. // Display events that are passed from hosted field
347. var events = {
348. 'hostedfield:create.example' : showEvent,
349. 'hostedfield:destroy.example' : showEvent,
350. 'hostedfield:ready.example' : showEvent,
351. 'hostedfield:style.example' : showEvent,
352. 'hostedfield:placeholder.example' : showEvent,
353. 'hostedfield:invalid.example invalid.example' : showEvent,
354. 'hostedfield:userinvalid.example userinvalid.example' : showEvent,
355. 'hostedfield:valid.example valid.example' : showEvent,
356. 'hostedfield:uservalid.example uservalid.example' : showEvent,
357. 'hostedfield:disabled.example disabled.example' : showEvent,
358. 'hostedfield:enabled.example enabled.example' : showEvent,
359. 'hostedfield:required.example required.example' : showEvent,
360. 'hostedfield:optional.example optional.example' : showEvent,
361. 'hostedfield:readonly.example readonly.example' : showEvent,
362. 'hostedfield:readwrite.example readwrite.example' : showEvent,
363. 'hostedfield:focus.example focus.example' : showEvent,
364. 'hostedfield:blur.example blur.example' : showEvent,
365. 'hostedfield:mouseenter.example mouseenter.example' : showEvent,
366. 'hostedfield:mouseleave.example mouseleave.example' : showEvent,
V2.00
- 345 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 346 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 347 -
GATEWAY
INTEGRATION GUIDE
• Check your Merchant Account ID in your integration is correct. Our Gateway Merchant
Account IDs typically begin with 1 and are currently 6 digits long, eg 100001.
• Check that you are using the correct method for calculating the signature and the correct
secret signature key for the Merchant Account used.
• Make sure that you are not using an image form submit button because that will add fields
to the post that cannot be removed and will render the signature useless.
Refer to appendix A-13 for a step-by-step guide to creating a signature. If you use the same
values as in the example, you can check if your signature generation routine produces the same
results.
This test step by step generator is available from the Gateway at the following address1;
https://gateway.example.com/devtools/sigtest.php
3. I have more than one Merchant Account - how do I use more than one?
• You have a couple of options here. You can set up separate integrations for each Merchant
Account, which can be a bit inconvenient. Your other option is to request they are
connected together. Please contact our support team to get your Merchant Accounts
connected and you will then only need to use one.
• If you receive this error message, you are using test cards on a live Merchant Account.
Please only use live cards on live Merchant Accounts. Our test cards will only work on the
test Merchant Account provided when you sign up with us.
- 348 -
GATEWAY
INTEGRATION GUIDE
INDEX
1 Gateway Integration ........................................................................................................................................ 4
1.1 ABOUT THIS GUIDE ......................................................................................................................................................... 4
1.2 TERMINOLOGY................................................................................................................................................................. 5
1.3 INTEGRATION METHODS ................................................................................................................................................. 6
1.3.1 Hosted Integration .................................................................................................................................................... 6
1.3.2 Direct Integration ...................................................................................................................................................... 7
1.3.3 Batch Integration ...................................................................................................................................................... 7
1.4 INTEGRATION LIBRARIES ................................................................................................................................................. 8
1.5 SECURITY AND COMPLIANCE .......................................................................................................................................... 9
1.6 PREREQUISITES ............................................................................................................................................................ 10
1.7 INTEGRATION DETAILS .................................................................................................................................................. 11
1.7.1 HTTP Requests ...................................................................................................................................................... 11
1.7.2 Hosted HTTP Requests......................................................................................................................................... 12
1.7.3 Direct HTTP Requests ........................................................................................................................................... 12
1.7.4 Batch HTTP Requests ........................................................................................................................................... 13
1.7.5 Handling Errors ....................................................................................................................................................... 15
1.7.6 Redirect URL ........................................................................................................................................................... 16
1.7.7 Callback URL .......................................................................................................................................................... 16
1.7.8 Field Formats .......................................................................................................................................................... 17
1.8 AUTHENTICATION .......................................................................................................................................................... 18
1.8.1 Password Authentication ....................................................................................................................................... 18
1.8.2 Message signing ..................................................................................................................................................... 18
1.8.3 Allowed IP addresses ............................................................................................................................................ 18
1.9 SUPPORTED ACTIONS ................................................................................................................................................... 19
1.9.1 SALE ........................................................................................................................................................................ 19
1.9.2 VERIFY .................................................................................................................................................................... 19
1.9.3 PREAUTH ............................................................................................................................................................... 19
1.9.4 REFUND_SALE...................................................................................................................................................... 20
1.9.5 REFUND .................................................................................................................................................................. 20
1.9.6 CAPTURE ............................................................................................................................................................... 20
1.9.7 CANCEL .................................................................................................................................................................. 21
1.9.8 QUERY .................................................................................................................................................................... 21
2 New Transactions .......................................................................................................................................... 22
2.1 REQUEST FIELDS .......................................................................................................................................................... 22
2.2 RESPONSE FIELDS ........................................................................................................................................................ 24
3 Management Requests .................................................................................................................................. 26
3.1 REQUEST FIELDS .......................................................................................................................................................... 26
3.2 RESPONSE FIELDS ........................................................................................................................................................ 27
4 AVS/CV2 Checking ........................................................................................................................................ 28
4.1 BACKGROUND ............................................................................................................................................................... 28
4.1.1 AVS Checking ......................................................................................................................................................... 28
4.1.2 CV2 Checking ......................................................................................................................................................... 28
4.2 BENEFITS AND LIMITATIONS.......................................................................................................................................... 29
4.2.1 Benefits .................................................................................................................................................................... 29
4.2.2 Limitations ............................................................................................................................................................... 29
4.3 REQUEST FIELDS .......................................................................................................................................................... 30
4.4 RESPONSE FIELDS ........................................................................................................................................................ 31
5 3-D Secure Authentication ............................................................................................................................ 32
5.1 BACKGROUND ............................................................................................................................................................... 32
5.2 BENEFITS AND LIMITATIONS.......................................................................................................................................... 33
5.2.1 Benefits .................................................................................................................................................................... 33
5.2.2 Limitations ............................................................................................................................................................... 33
5.3 HOSTED IMPLEMENTATION ........................................................................................................................................... 34
5.4 DIRECT IMPLEMENTATION ............................................................................................................................................. 35
5.4.1 Initial Request (Verify Enrolment) ........................................................................................................................ 36
V2.00
- 349 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 350 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 351 -
GATEWAY
INTEGRATION GUIDE
- 352 -
GATEWAY
INTEGRATION GUIDE
- 353 -
GATEWAY
INTEGRATION GUIDE
- 354 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 355 -
GATEWAY
INTEGRATION GUIDE
V2.00
- 356 -