For merchants who wish to embed a payment link in a SMS or an email, you can send a request to HPP to create a transaction to be paid within 24 hours. HPP will respond with the dedicated payment URL which can then be sent to your customer.
Please note the request to HPP must be sent with the following header: Content-Type: application/json
In order to generate the link, the HTTP request must be sent to HPP with a JSON body. For information on each request field and how to construct the request hash, please refer to our Process a Payment documentation. The link generated is returned within a JSON object and will be valid for 24 hours.
curl https://pay.sandbox.elavonpaymentgateway.com/pay
-H "Content-type: application/json"
-X POST
-d '{
"TIMESTAMP":"20181017100348",
"MERCHANT_ID":"MerchantId",
"ACCOUNT":"internet",
"ORDER_ID":"N6qsk4kYRZihmPrTXWYS6g",
"AMOUNT":"1001",
"CURRENCY":"EUR",
"SHA1HASH":"308bb8dfbbfcc67c28d602d988ab104c3b08d012",
"AUTO_SETTLE_FLAG":"1",
"COMMENT1":"Mobile Channel",
"TIMESTAMP":"20180613110737",
"MERCHANT_ID":"MerchantId",
"ACCOUNT":"internet",
"ORDER_ID":"N6qsk4kYRZihmPrTXWYS6g",
"AMOUNT":"1999",
"CURRENCY":"EUR",
"AUTO_SETTLE_FLAG":"1",
"COMMENT1":"Mobile Channel",
"HPP_VERSION":"2",
"HPP_LANG":"en",
"HPP_CUSTOMER_EMAIL":"test@example.com",
"HPP_CUSTOMER_PHONENUMBER_MOBILE":"44|789456123",
"HPP_BILLING_STREET1":"Flat 123",
"HPP_BILLING_STREET2":"House 456",
"HPP_BILLING_STREET3":"Unit 4",
"HPP_BILLING_CITY":"Halifax",
"HPP_BILLING_POSTALCODE":"W5 9HR",
"HPP_BILLING_COUNTRY":"826",
"HPP_SHIPPING_STREET1":"Apartment 852",
"HPP_SHIPPING_STREET2":"Complex 741",
"HPP_SHIPPING_STREET3":"House 963",
"HPP_SHIPPING_CITY":"Chicago",
"HPP_SHIPPING_STATE":"IL",
"HPP_SHIPPING_POSTALCODE":"50001",
"HPP_SHIPPING_COUNTRY":"840",
"HPP_ADDRESS_MATCH_INDICATOR":"FALSE",
"HPP_CHALLENGE_REQUEST_INDICATOR":"NO_PREFERENCE",
"BILLING_CODE":"59|123",
"BILLING_CO":"GB",
"SHIPPING_CODE":"50001|Apartment 852",
"SHIPPING_CO":"US",
"CUST_NUM":"6e027928-c477-4689-a45f-4e138a1f208a",
"VAR_REF":"Acme Corporation",
"PROD_ID":"SKU1000054",
"MERCHANT_RESPONSE_URL":"https://www.example.com/responseUrl",
"SUPPLEMENTARY_DATA":"Custom Value"}'{
"hppPayByLink": "https://pay.sandbox.elavonpaymentgateway.com/pay/card.html?guid=f82dc878-4752-4d25-8c4b-7d48b3a863ec"
}Your application can now send this link to your customer, for example via email or SMS. Once clicked, they will be redirected to the HPP to complete payment. The HPP can be customised using our template system to maintain the look-and-feel of your brand and customer experience. Please see the Customisation documentation.
Once payment is complete, HPP will return the transaction response to a nominated URL that can be supplied in the POST (MERCHANT_RESPONSE_URL). The response will contain a hashed string (SHA1HASH field) made up of key transaction variables, including the Order ID, Result Code and Timestamp. This must be constructed and checked by your application to ensure the response has not been tampered with, please refer to our Process a Payment documentation
The Timestamp returned in the response will be identical to the one set in the request POST. This, combined with the Order ID and other transaction variables, can be used to definitively link the response received with the transaction request and order created in your application. You should also check the other transaction variables, for example the Amount, against what was stored in your application at the time the request POST was sent.
If invalid data is submitted the HPP will return JSON string(s) indicating the issue with each field.
{
"errors": [
{
"resultCode": 508,
"internalErrorCode": 61755,
"errorMessage": "Parsing Failure due to Invalid JSON."
}
]
}For example, the value sent in the ACCOUNT field does not exist on your Client ID.
{
"errors": [
{
"resultCode": 506,
"internalErrorCode": 61201,
"errorMessage": "Invalid MERCHANT_ID or ACCOUNT. Please contact the merchant."
}
]
}The amount sent in the AMOUNT field contained a decimal point.
{
"errors": [
{
"resultCode": 508,
"internalErrorCode": 61015,
"errorMessage": "Invalid characters in AMOUNT field. Please contact the merchant."
}
]
}