Authentication

Authentication requires generating a hashed message authentication code (HMAC-SHA256).

A signature is created by using a sorted string of all parameters in the request (except for api_key​, ​ signature,​ product_description, and preferred_product_typeparameters) with the format “​{PARAMETER}​={value}​&” . Parameter key should be upper-cased and value is provided as is.

Example

{
    "amount": "300.00",
    "api_key": "IHEu22iGjmDokj72aCRVl5Ol",
    "success_url": "http://www.supplier.com/success/",
    "failure_url": "http://www.supplier.com/failure/",
    "preferred_product_type": "paylater",
    "currency": "GBP",
    "order_reference": "26352",
    "signature": "429b5cc0ebb3da57fb55992757c36377f42e9df8672971befa772b99124c2923",
    "first_name": "John",
    "last_name": "Smith",
    "product_description": [
        {
            "item": "Pirelli Cinturato P7 Tyre",
            "quantity": "2",
            "price": "150.00"
        },
        {
            "item": "Pirelli Cinturato P8 Tyre",
            "quantity": "1",
            "price": "150.00"
        }
    ],
    "email": "john@smith.com",
    "product_id": "4",
    "mobile": "0778879989",
    "vehicle_reg": "XYZ1234",
    "flat_number": "23",
    "building_name": "ABC Building",
    "building_number": "39",
    "street": "DEF way",
    "town": "Southampton",
    "county": "Hampshire",
    "postcode": "SO14 3AB",
    "country": "UK",
    "send_sms": false,
    "send_email": false
}

Sorted and upper-cased:

AMOUNT=300.00&BUILDING_NAME=ABC Building&BUILDING_NUMBER=39&COUNTRY=UK&COUNTY=Hampshire&CURRENCY=GBP&EMAIL=john@smith.com&FAILURE_URL=http://www.supplier.com/failure/&FIRST_NAME=John&FLAT_NUMBER=23&LAST_NAME=Smith&MOBILE=0778879989&ORDER_REFERENCE=26352&POSTCODE=SO14 3AB&PRODUCT_ID=4&SEND_EMAIL=False&SEND_SMS=False&STREET=DEF way&SUCCESS_URL=http://www.supplier.com/success/&TOWN=Southampton&VEHICLE_REG=XYZ1234&

Using a secret of "9f*u/[`tt*.*k725X;u&Zkz , this string would result in the following signature hash:

8be9b278125a4fa15c2af43f28307d2af90ec4c1e8f52c096b0652a1b66d49c7

Last updated