Contents

JSON Web Token

User
You need a user account with the role “Webservices JWT” to create the token.
If this user account has not already been provided, please request that one is created for your site(s) by contacting our Support Team.

 

The jwt field submitted in the form will need to be in the form of a JSON Web Token (JWT), which consists of encoded data.
JSON Web Tokens are an open, industry standard RFC 7519 method for securely transmitting data between two parties.
We recommend using the libraries found at https://jwt.io to generate the JWT.

In its compact form, JWT consists of three parts separated by dots (“.”), which are:
<header>.<payload>.<signature>

 


 

Generating the header

The header consists of two parts:

These need to be Base64URL encoded to form the first part of the JWT. Example:

Important: Submitted data must be Base64Url encoded, rather than standard Base64.

 


 

Generating the payload

The second part of the token is the payload. The following fields can be included:

Field Format Description
iat Numeric (17) Time in seconds since Unix epoch (generated using UTC).

Click here for further info.

iss Alphanumeric (255) Your JWT username.
payload    
  accounttypedescription Alphanumeric (20) Value submitted is “ECOM” (represents an e-commerce transaction).
  authmethod Alphanumeric (5) Click here for further info.
  billingprefixname Alphanumeric (25) Billing name.
  billingfirstname Alphanumeric (127)
  billingmiddlename Alphanumeric (127)
  billinglastname Alphanumeric (127)
  billingsuffixname Alphanumeric (25)
  billingpremise Alphanumeric (25) Billing address.
  billingstreet Alphanumeric (127)
  billingtown Alphanumeric (127)
  billingpostcode Alphanumeric (25)
  billingcounty Alphanumeric (127) Billing county.

Note: If submitted, billingcountryiso2a is required.

  billingcountryiso2a iso2a Billing country in iso2a format.

Required if billingcounty is submitted.

Otherwise, Optional.

  billingemail Email (255) Billing email address.
  billingtelephone Alphanumeric (20) Billing telephone number.
  billingtelephonetype Char (1) Type of billing phone number:

  • “H” – Home
  • “M” – Mobile
  • “W” – Work
  credentialsonfile Numeric (1) This is required for Visa and Mastercard transactions where the merchant is utilising the Credentials on File (CoF) feature. If the transaction is not eligible for CoF, or you do not wish to use credentials for future transactions, you can omit this field.The allowed values for this field are 0, 1 & 2.

  • 0 – Not eligible for CoF, or no intention of re-using credentials at a later time.
  • 1 – Transaction credentials flagged as available for future use (required when scheduling a subscription). Note: Visa and Mastercard have mandated that you must obtain cardholder consent before storing card details for future use. Click here for further information
  • 2 – Payment using previously-stored credentials.
  customerprefixname Alphanumeric (25) Delivery name.
  customerfirstname Alphanumeric (127)
  customermiddlename Alphanumeric (127)
  customerlastname Alphanumeric (127)
  customersuffixname Alphanumeric (25)
  customerpremise Alphanumeric (25) Delivery address.
  customerstreet Alphanumeric (127)
  customertown Alphanumeric (127)
  customercounty Alphanumeric (127)
  customercountryiso2a iso2a
  customerpostcode Alphanumeric (25)
  customeremail Email (255) Delivery email address.
  customertelephone Alphanumeric (20) Delivery telephone number.
  customertelephonetype Char (1) Type of delivery phone number:

  • “H” – Home
  • “M” – Mobile
  • “W” – Work
  currencyiso3a iso3a The currency that the transaction was processed in.

Click here for further info.

  baseamount Numeric (13) Either baseamount or mainamount must be included (not both).

The amount of the transaction in base units (without any decimal places). e.g. £10.50 would be submitted as “1050”

  mainamount Numeric (14) Either baseamount or mainamount must be included (not both).

The amount of the transaction in main units.
Only include the amount value and the decimal place (no commas).
e.g. £10.99 would be submitted as 10.99
Currencies such as Japanese Yen which do not require a decimal place are submitted without. e.g. 1000 Yen would be 1000

  initiationreason Char (1) This is required when processing a Merchant Initiated Transaction (MIT).Allows you to assign a reason for the transaction.

Do not submit when processing a Customer Initiated Transaction (CIT).

The allowed values for this field are “A”, “C”, “D”, “S” and “X”.

  • “A” – Reauthorisation
  • “C” – Unscheduled payment
  • “D” – Delayed Charges
  • “S” – Resubmission
  • “X” – No-show (for a hotel booking)

Please refer to Visa’s own documentation for further information.

  locale Undefined By default, the checkout form and any error messages displayed will be rendered in British English. But this behaviour can be overridden by submitting the following locale values in the payload:

  • ‘cy_GB’ Welsh (United Kingdom)
  • ‘da_DK’ Danish (Denmark)
  • ‘de_DE’ German (Germany)
  • ‘en_US’ English (United States)
  • ‘en_GB’ English (United Kingdom)
  • ‘es_ES’ Spanish (Spain)
  • ‘fr_FR’ French (France)
  • ‘nl_NL’ Dutch (The Netherlands)
  • ‘no_NO’ Norwegian (Norway)
  • ‘sv_SE’ Swedish (Sweden)
  operatorname Alphanumeric (255) The value of this field contains the name of the user that processed the request. This is optional. If omitted, the value of the alias will be recorded instead, which will either be your site reference or Web Services username, depending on your configuration.
  orderreference Alphanumeric (255) Your unique order reference that can be stored on the Trust Payments system.

We strongly recommend you submit an orderreference for each transaction.

  parenttransactionreference Alphanumeric including hyphens (25) Allows you to specify the transactionreference of a previous request. Key details are inherited from this request.
  requesttypedescriptions List The request types to be processed.
To process a 3-D Secure authenticated payment, submit [“THREEDQUERY”,”AUTH”].Important: You must ensure “THREEDQUERY” is submitted in this list when performing transactions, in order to ensure 3-D Secure is processed. This is required by the PSD2 mandate.To learn more about supported request types, click here.
  settleduedate Date YYYY-MM-DD Here you can set which day in the future you wish for your transaction to settle. It must be in the format:
YYYY-MM-DD.
  settlestatus Numeric (3) A numeric value used to define the settlement instruction.

  • “0” – Automatic (default when no value submitted)
  • “1” – Manual
  • “2” – Suspended
  sitereference Alphanumeric (50) Unique reference that identifies your Trust Payments site.
  subscriptionbegindate Date YYYY-MM-DD This field refers to the when the first automated payment will be processed. From there onward, we will use the data submitted in the subscriptionunit and subscriptionfrequency fields to automatically process the subscription payments at regular intervals.e.g. If a subscription request is submitted on 5th January 2018

the interval is 1 MONTH (subscriptionfrequency = 1 and subscriptionunit = MONTH)

and subscriptionbegindate is 2018-01-08,

the first automated payment will be processed on 8th January 2018, and all subsequent payments will be processed on the 8th of each month.

If you do not submit the subscriptionbegindate, we will use the subscriptionunit and subscriptionfrequency fields above to automatically schedule the first automated payment.
e.g. In the same scenario as above, but without submitting the subscriptionbegindate, the first automated payment would be processed on 5th February 2018 (1 MONTH after the original request). All subsequent payments will be processed on the 5th of each month.

  subscriptionfinalnumber Numeric (5) This is used to set the number of payments to be processed over the course of the subscription:

  • If processing a combined AUTH SUBSCRIPTION request:
    If subscriptionnumber = 1

    and subscriptionfinalnumber = 12
    There will be 12 payments in total (The initial AUTH + 11 subscription payments)
  • If processing a combined ACCOUNTCHECK SUBSCRIPTION request:
    If subscriptionnumber = 1

    and subscriptionfinalnumber = 12
    There will be 11 payments in total (The initial ACCOUNTCHECK + 11 subscription payments)

    (The initial ACCOUNTCHECK counts against the final number)

Note: If the value is “0”, the subscription engine will schedule payments indefinitely until the user manually sets the subscription to Inactive.

  subscriptionfrequency Numeric (11) Combined with unit, the frequency defines how frequently payments are processed.e.g. For one payment every 7 days: subscriptionfrequency = 7 and subscriptionunit = DAY

e.g. For one payment every 2 months: subscriptionfrequency = 2 and subscriptionunit = MONTH

  subscriptionnumber Numeric (5) Unless specified otherwise, subscriptions start with subscriptionnumber = 1 by default. The subscriptionnumber is automatically incremented in every subsequent subscription payment until it exceeds the value of the subscriptionfinalnumber field, when no further payments will be attempted. A completed subscription is represented by a subscriptionnumber that is higher than the corresponding subscriptionfinalnumber.
  subscriptiontype Alpha (11) This field indicates the type of subscription to be processed. Your system can submit these two values:

  • RECURRING is used when the customer is performing a recurring payment for a new product/service each time (for example, a magazine subscription). For most merchants, the subscriptiontype should be set to “RECURRING”.
  • INSTALLMENT is only used in select cases with certain acquirers. It is designed for when a customer is purchasing a single order, with payment being collected over several installments (for example, paying £100 a month for an order until it has been paid in full).

Note: Installments are only accepted by certain acquirers. For further info, please contact your bank.

  subscriptionunit Alpha (5)

This field represents the unit of time between each subscription. This can be either “DAY” or “MONTH”.

Note: It is imperative that this field is submitted to the gateway in CAPITALS (“DAY” or “MONTH”).

  transactionactive Numeric (1) The subscription status.“0” – Inactive: Suspends future payments until manually overridden.

“1” – Active: Schedules subscription payments immediately, bypassing fraud & duplicate checks (if enabled).

“2” – Pending (default): Schedules subscription payments after the AUTH has been settled (settlestatus “100”).

  threedbypasspaymenttypes List In order to comply with PSD2, you must perform 3-D Secure authentication with all supported card-based e-commerce transactions. This is achieved by ensuring THREEDQUERY is included in the requesttypedescriptions list in the JWT payload. However, your solution may encounter circumstances in which 3-D Secure is not required / supported by your acquiring bank. By specifying payment types in the threedbypasspaymenttypes list, 3-D Secure authentication will not be performed for the aforementioned payment types.
  termurl URL (1024) Required for 3-D Secure authentication.

This URL is used to instruct the card issuer where to send the customer’s browser after they have been authenticated on the card issuer’s ACS. You must submit the following URL in this field when performing 3-D Secure:

https://payments.securetrading.net/process/payments/mobilesdklistener

 

Info
When submitting fields in the payload, please follow the below recommendations:

  • The payload should contain all fields that you do not want to allow the customer to modify (e.g. the transaction amount).
  • The payload should not contain any fields that the customer is allowed to modify while on your checkout (e.g. their address or contact details).

 

These fields are then Base64URL encoded to form the second part of the JWT. Example:


{"payload":{"accounttypedescription":"ECOM","baseamount":"1050","currencyiso3a":"GBP","sitereference":"test_site12345","termurl":"https:\/\/payments.securetrading.net\/process\/payments\/mobilesdklistener","requesttypedescriptions":["THREEDQUERY","AUTH"]},"iat":1559033849,"iss":"jwt.user"}
eyJwYXlsb2FkIjp7ImFjY291bnR0eXBlZGVzY3JpcHRpb24iOiJFQ09NIiwiYmFzZWFtb3VudCI6IjEwNTAiLCJjdXJyZW5jeWlzbzNhIjoiR0JQIiwic2l0ZXJlZmVyZW5jZSI6InRlc3Rfc2l0ZTEyMzQ1IiwidGVybXVybCI6Imh0dHBzOi8vcGF5bWVudHMuc2VjdXJldHJhZGluZy5uZXQvcHJvY2Vzcy9wYXltZW50cy9tb2JpbGVzZGtsaXN0ZW5lciIsInJlcXVlc3R0eXBlZGVzY3JpcHRpb25zIjpbIlRIUkVFRFFVRVJZIiwiQVVUSCJdfSwiaWF0IjoxNTU5MDMzODQ5LCJpc3MiOiJqd3QudXNlciJ9

 

Info
The baseamount field shown in the payload example above contains a value submitted in base units. This means that the value excludes the decimal point, so £10.50 would be submitted as “1050”.

We allow you to instead submit the mainamount here, if preferred. In this case, the value is submitted in main units (£10.50 would be submitted as “10.50” – notice the decimal point).

 


 

Generating the signature

The final part of the token is the signature. The signature is used to ensure the token wasn’t modified by the customer before the submitted form reaches Trust Payments.

The signature is created by taking the encoded header, the encoded payload, a “secret” and the algorithm specified in the header, and then signing them.

Padlock
The “secret” is a secret passphrase (in string format) you will need to include when signing the JWT. This will need to be agreed with our Support Team prior to the processing of requests to our system.

 

When storing the value of the secret on your system, you must ensure you do so in a secure manner.

 

The value of the secret must not be stored in plain text within the app itself.

 

Example – If you wanted to use the HMAC SHA256 algorithm, the signature would be created in the following way:


HMACSHA256(
  base64UrlEncode(header) + "." +
  base64UrlEncode(payload),
  secret)

Info
We do not support the signing of tokens with a private key.

 


 

Complete JWT example

The result is three Base64URL strings separated by dots (“.”):

If we take the header, the payload and the signature from the examples above, you would end up with the following JWT:


eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7ImFjY291bnR0eXBlZGVzY3JpcHRpb24iOiJFQ09NIiwiYmFzZWFtb3VudCI6IjEwNTAiLCJjdXJyZW5jeWlzbzNhIjoiR0JQIiwic2l0ZXJlZmVyZW5jZSI6InRlc3Rfc2l0ZTEyMzQ1IiwidGVybXVybCI6Imh0dHBzOi8vcGF5bWVudHMuc2VjdXJldHJhZGluZy5uZXQvcHJvY2Vzcy9wYXltZW50cy9tb2JpbGVzZGtsaXN0ZW5lciIsInJlcXVlc3R0eXBlZGVzY3JpcHRpb25zIjpbIlRIUkVFRFFVRVJZIiwiQVVUSCJdfSwiaWF0IjoxNTU5MDMzODQ5LCJpc3MiOiJqd3QudXNlciJ9.acGTiW8Px1iQmoP7Cf4qbqwwxK_4oezvbvOboMW0aCU

The full token can then be included when initialising the library.

 

Here is an example of how we generate a JWT from within our example app:

The creation of jwt is present in: MainViewModel.swift

Signing of the jwt is invoked in the same file and the implementation sits in the JWTHelper.swift


// In order to create valid JWT, firstly you need: username, site reference and jwt secret key
// then depending on framework of your choice for generating JWT you will need to specify following fields:
iss: "username"
iat: Date(),
payload: {see the documentation for required fields}

// example using SwiftJWT (IBM)
// 1: Create a data structure conforming to the Claim protocol
// 2: Create the payload structure conforming to Codable

// Creating the claim
let claim = TPClaims(iss: keys.merchantUsername,
                             iat: Date(timeIntervalSinceNow: 0),
                             payload: Payload(accounttypedescription: "ECOM",
                                              sitereference: keys.merchantSiteReference,
                                              currencyiso3a: "GBP",
                                              baseamount: baseAmount,
                                              termurl: "https://payments.securetrading.net/process/payments/mobilesdklistener",
                                              requesttypedescriptions:["THREEDQUERY","AUTH"]
                                              ))

// default header
let header = Header(typ: "JWT")

// base JWT without signature
let jwtSecretKey = "yourSecretKey"
var jwt = JWT(header: header, claims: claim)
guard let keyData = jwtSecretKey.data(using: .utf8) else { return }
let jwtSigner = JWTSigner.hs256(key: keyData)

// sign jwt with key
guard let signedJWT = try? jwt.sign(using: jwtSigner) else { return }

// verify JWT just to make sure
let jwtVerifier = JWTVerifier.hs256(key: keyData)
guard JWT<T>.verify(signedJWT, using: jwtVerifier) else { return }

// For complete solution please refer to the code examples in the Example App:
// JWTHelper.swift
// MainViewModel.swift

 


 

Verify the response JWT signature

The outcome of the request processed will be returned in the form of a new JWT. The following is an example of a response returned by Trust Payments:


"jwt":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1OTQ2NDcyNjgsInBheWxvYWQiOnsicmVxdWVzdHJlZmVyZW5jZSI6Ilc1Ni11YWN3bTU0ayIsInZlcnNpb24iOiIxLjAwIiwiand0IjoiZXlKaGJHY2lPaUpJVXpJMU5pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SnBjM01pT2lKcWQzUXRjR2R6Ylc5aWFXeGxjMlJySWl3aWFXRjBJam94TlRrME5qUTNNalk0TENKd1lYbHNiMkZrSWpwN0luQmhjbVZ1ZEhSeVlXNXpZV04wYVc5dWNtVm1aWEpsYm1ObElqb2lOVFl0T1MweE5ETTBNek1pTENKaVlYTmxZVzF2ZFc1MElqb3hNRFV3TENKamRYSnlaVzVqZVdsemJ6TmhJam9pUjBKUUlpd2ljMmwwWlhKbFptVnlaVzVqWlNJNkluUmxjM1JmY0dkemJXOWlhV3hsYzJSck56azBOVGdpTENKaFkyTnZkVzUwZEhsd1pXUmxjMk55YVhCMGFXOXVJam9pUlVOUFRTSjlmUS53MHc2eGhzaGRMMmY4dm5PRWpXMmZvdHJUZ0lGU0RzZ2lxd3VlU21lbExnIiwicmVzcG9uc2UiOlt7ImF1dGhtZXRob2QiOiJGSU5BTCIsInRyYW5zYWN0aW9uc3RhcnRlZHRpbWVzdGFtcCI6IjIwMjAtMDctMTMgMTM6MzQ6MjgiLCJwYXJlbnR0cmFuc2FjdGlvbnJlZmVyZW5jZSI6IjU2LTktMTQzNDMyIiwiY3VzdG9tZXJvdXRwdXQiOiJSRVNVTFQiLCJsaXZlc3RhdHVzIjoiMCIsIm1lcmNoYW50bmFtZSI6InBncyBtb2JpbGUgc2RrIiwic3BsaXRmaW5hbG51bWJlciI6IjEiLCJkY2NlbmFibGVkIjoiMCIsInNldHRsZWR1ZWRhdGUiOiIyMDIwLTA3LTEzIiwiZXJyb3Jjb2RlIjoiMCIsImNhdnYiOiJZMkZ5WkdsdVlXeGpiMjF0WlhKalpXRjFkR2c9IiwibWVyY2hhbnRudW1iZXIiOiIwMDAwMDAwMCIsIm1lcmNoYW50Y291bnRyeWlzbzJhIjoiR0IiLCJzdGF0dXMiOiJZIiwidHJhbnNhY3Rpb25yZWZlcmVuY2UiOiI1Ni05LTE0MzQzMyIsInRocmVlZHZlcnNpb24iOiIyLjEuMCIsInBheW1lbnR0eXBlZGVzY3JpcHRpb24iOiJNQVNURVJDQVJEIiwiYmFzZWFtb3VudCI6IjEwNTAiLCJlY2kiOiIwMiIsImFjY291bnR0eXBlZGVzY3JpcHRpb24iOiJFQ09NIiwidGlkIjoiMjc4ODI3ODgiLCJhY3F1aXJlcnJlc3BvbnNlY29kZSI6IjAwIiwicmVxdWVzdHR5cGVkZXNjcmlwdGlvbiI6IkFVVEgiLCJzZWN1cml0eXJlc3BvbnNlc2VjdXJpdHljb2RlIjoiMiIsImN1cnJlbmN5aXNvM2EiOiJHQlAiLCJhdXRoY29kZSI6IlRFU1Q5NSIsImVycm9ybWVzc2FnZSI6Ik9rIiwiaXNzdWVyY291bnRyeWlzbzJhIjoiWloiLCJtYXNrZWRwYW4iOiI1MjAwMDAjIyMjIyMxMDA1Iiwic2VjdXJpdHlyZXNwb25zZXBvc3Rjb2RlIjoiMCIsImVucm9sbGVkIjoiWSIsInNlY3VyaXR5cmVzcG9uc2VhZGRyZXNzIjoiMCIsIm9wZXJhdG9ybmFtZSI6Imp3dC1wZ3Ntb2JpbGVzZGsiLCJzZXR0bGVzdGF0dXMiOiIwIn1dLCJzZWNyYW5kIjoiZGdjNlFKOEk1In0sImF1ZCI6Imp3dC1wZ3Ntb2JpbGVzZGsifQ.VFRbxnqcgaitlPSTLbHhpz9Tq-cQZgjk6lp3T9V2FUQ"

 

Info
If an error has occurred, we may not be able to encode the response and, as a result, the response may be only an errorcode and errormessage.

In this scenario, we recommend asking the customer to try the payment again.

e.g. errorcode 50000, errormessage “Timeout”.

 

To view the full response, you will need to decode the JWT returned.

External
We recommend using the libraries found at https://jwt.io to decode the JWT.

The response JWT consists of three parts separated by dots (“.”), in the following format:

Header.Payload.Signature

Warning
Before you can trust the response, you need to check the signature returned matches the value expected. If not, it may have been modified by an unauthorised party.

The signature is hashed using SHA-256, and as such, cannot be decoded. This means that to check the signature is correct, your system will need to re-calculate it using the header and payload returned.
Providing you use the same secret during this process, the recalculated signature should match that returned in the response JWT. In summary:

  1. Base64URL decode JWT header
  2. Base64URL decode JWT payload
  3. Re-generate the signature by re-encoding the header, the payload and signing them with your secret.
    (as explained above)

 

Parse the payload

We provide a parsing utility to extract the payload field data as part of reviewing the payment response fields:


transactionResponseClosure: { [unowned self] responseJwtList, threeDResponse, error in

                // Every JWT returned from the SDK should be verified before further usage.
                let isVerified = !responseJwtList.map { JWTHelper.verifyJwt(jwt: $0, secret: self.appFoundation.keys.jwtSecretKey) }.contains(false)

                AppLog.log("JWT verification status: \(isVerified)")

                if !isVerified {
                    // throw error and show the appropriate message
                    return
                }

                // error indicating that there was a general error in connecting to the server or in 3dsecure authentication (APIClientError enum)

                guard let error = error else {

                    // a parsing utility
                    guard let tpResponses = try? TPHelper.getTPResponses(jwt: responseJwtList) else { return }

                    // an example of how to get a card reference object which in version 1.0.0 was part of the closure (TPCardReference object)
                    let cardReference = tpResponses.last?.cardReference

                    // an example of how to get the JWTResponseObject array which in version 1.0.0 was part of the closure
                    let responseObjects = tpResponses.flatMap { $0.responseObjects }

                    // an example of how to find a response object that interests us
                    let riskDecResponse = tpResponses.compactMap { $0.responseObjects.first(where: { $0.requestTypeDescription(contains: TypeDescription.riskDec) }) }.first
 
                    // the error object constructed from the errorcode property (in version 1.0.0 it was part of the APIClientError class, in version 2.0.0 the TPError class was created)
                    guard let firstTPError = tpResponses.compactMap({ $0.tpError }).first else {

                        self.showAlert(controller: self.navigationController, message: LocalizableKeys.DropInViewController.successfulPayment.localizedStringOrEmpty) { _ in
                            self.navigationController.popViewController(animated: true)

                        }
                        return
                    }
                    if case TPError.invalidField(let errorCode, let localizedError) = firstTPError {
                        AppLog.log("RESPONSEVALIDATIONERROR.INVALIDFIELD: code: \(errorCode.rawValue), message: \(localizedError ?? errorCode.message)")
                    }

                    if case TPError.gatewayError(let errorCode, let error) = firstTPError {
                        AppLog.log("GATEWAYERROR: responseErrorCode: \(errorCode.rawValue)), errorCode: \((error as NSError).code) message: \(error.localizedDescription)")
                    }

                    self.showAlert(controller: self.navigationController, message: firstTPError.humanReadableDescription) { _ in }
                    return
                }

                self.showAlert(controller: self.navigationController, message: error.humanReadableDescription) { _ in }
            }

 

Response fields

After you receive the response, we recommend you review the information below when handling the customer’s payment session:

 

Transaction reference

The transactionreference is a unique identifier for the transaction. You will need to record this reference in order to query or perform other actions on this transaction at a later time.

 

Order reference

The orderreference is a custom identifier for the transaction that we recommend you submit in the JWT payload of each transaction. If your system has been configured to assign orderreference values to your transactions, you can use these to ensure you are checking the correct response following a payment.

 

Request type

You will need to check the requesttypedescription returned in the response. Only values of “AUTH” indicate the authorisation of a payment. Click here for a full list of different request types supported by Trust Payments.

 

Error code

You will need to check the errorcode returned to determine the outcome of the transaction:

Error code Description Actions required
0 Successful transaction. None.
30000 Indicates invalid data has been submitted within the payload of the JWT. Check the fields submitted within the payload of the JWT meet our specification.
60010
60034
99999
This can be due to a communication problem with a bank or third party. We recommend informing the customer of the problem and to contact you to query the issue. You will need to contact our Support Team, providing a copy of the entire request submitted and response returned, and we will contact the relevant parties to establish the status of the request. In the interest of security, ensure you omit or mask sensitive field values, such as card details.
60022 The customer was prompted for authentication, but failed this part of the process, meaning the transaction was not authorised. Provide customer with alternative means of payment and allow them to try again.
70000 Authorisation for the payment was attempted but was declined by the issuing bank.
Other Click here for a full list of errorcode values that can be returned. Depends on the errorcode returned.

 

Settle status

You will need to check the settlestatus returned in the response:

Settle status Description Actions required
0 Pending automatic settlement. None.
1 Pending manual settlement (overrides fraud / duplicate checks, if enabled).
2 Payment authorised but suspended on the Trust Payments system. Manually investigate the transaction to determine the reason the payment was suspended. If you are okay to proceed, you can update the transaction to allow settlement.
3 Payment cancelled. Look at the errorcode to determine the reason the payment was not completed.

 

3-D enrolled

The enrolled field will inform you if the customer’s card is enrolled in 3-D Secure:

3-D enrolled Description Actions required
Y The customer’s card is enrolled. Handled by the Mobile SDK.
N The customer’s card is not enrolled.
U Unable to determine if card is enrolled.
B Merchant authentication rule is triggered to bypass authentication in this use case.

 

3-D status

The status field will inform you if the customer was successfully authenticated during the 3-D Secure process:

3-D status Description Actions required
Y The customer was successfully authenticated. None. The Mobile SDK will handle these cases automatically.
A Authentication attempted but not completed.
U Authentication couldn’t be performed.
C Challenge required for authentication.
N The customer was not authenticated. The payment will not be processed.
  • We strongly recommend against attempting further payments with this card, as the customer failed authentication, indicating an elevated risk of fraud.
  • Instead, we recommend displaying an error message to the customer stating the payment was not completed, and offer alternative methods of payment.

 

R Authentication was rejected. The payment will not be processed.

 

3-D version

The version field specifies the version of 3-D Secure used for the payment. The value will start with either “1.x.x” to denote 3-D Secure v1, or “2.x.x” to denote 3-D Secure v2.

 


 

Tick
Your progress

Now you have learnt how to handle the JWT for a transaction, we now recommend you configure webhooks to ensure you are notified of transactions processed on your account.

Click here to continue >>>