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",
    "is_preapproval_link": "true",
    "preapproval_token": "32248992",
    "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&IS_PREAPPROVAL_LINK=true&LAST_NAME=Smith&MOBILE=0778879989&ORDER_REFERENCE=26352&POSTCODE=SO14 3AB&PREAPPROVAL_TOKEN=32248992&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:

429b5cc0ebb3da57fb55992757c36377f42e9df8672971befa772b99124c2923

Last updated