LCN read receipt response for 2Checkout

To validate the success of the notification process insert an inline response in the script output of your LCN listener. Once 2Checkout validates the response it considers the LCN successful. Otherwise, 2Checkout continues to send notifications per the failure recovery process until you provide a valid response.

Requirements

  1. Do not include HASH in the string needed for calculating the HMAC_MD5 / HMAC_SHA2/HMAC_SHA3 signature.

  2. Use the variables in the same order as described above when putting together the string used for the HASH signature.

  3. To create the HMAC_MD5 / HMAC_SHA source string, prefix each value with its own length in bytes (for UTF-8 characters the length in bytes might be longer that the string length).

  4. HASH fields values are case insensitive.

  5. Output the inline response anywhere in the page receiving the notification.

Read receipt response for 2Checkout

To validate the fact that you received a LCN notification, return an inline response anywhere in the document (in the script output), in the following format:

  • <EPAYMENT>DATE|HASH</EPAYMENT> (if MD5 is used)

  • <sig algo="sha256" date= " ">HASH</sig> (if SHA256 is used)

  • <sig algo="sha3-256" date= " ">HASH</sig> (if SHA3-256 is used)

The parameters are as follows:

Parameters

DATE

Date in the YmdGis format. (20081117145935)

HASH

HMAC_MD5 / HMAC_SHA signature calculated using the secret key for your account and the values received for :

• LICENSE_CODE • EXPIRATION_DATE • DATE (the above field)

Create the hash using only these three parameters, and not all the parameters you receive as part of the LCN message.

HMAC_SHA signature

Access https://datatracker.ietf.org/doc/html/rfc6234 for a description of the SHA-based HMAC algorithm, or http://www.ietf.org/ rfc/rfc2104.txt for a description of the HMAC_MD5 algorithm.

Expand table

Field name

Field length

Field value

FIRSTNAME

4

John

LASTNAME

5

Smith

COMPANY

0

PHONE

12

951-121-2121

FAX

0

COUNTRY

24

United States of America

STATE

8

New York

CITY

8

New York

ADDRESS

15

101 Main Street

LICENSE_CODE

10

3C343D0FAF

EXPIRATION_DATE

10

2005-03-03

STATUS

8

DISABLED

Considering a LCN containing all the information above, you only need the LICENSE_CODE, EXPIRATION_DATE and DATE (this is the date when your script receives the LCN message) to create the response. Calculate the signature for the above data received in LCN and create inline response:

DATE

20081117145935. This is the date when your script receives the LCN message.

HMAC_SHA / HMAC_MD5 source string

103C343D0FAF102005-03-031420081117145935

Secret key

AABBCCDDEEFF

HMAC_MD5 signature

cb34fe2991668eb82364edf62f845a34

HMAC_SHA2 signature

cdd64ce75e6cf013a60291229c83063a5d903eae3bfa216e99aae8af65a055e8

HMAC_SHA3 signature

7fc19d21103ea56f1b413315fb3feb5fbdd137758623a73c7ed12d9bb84f21db

Inline response MD5

<EPAYMENT>20081117145935|cb34fe2991668eb82364edf62f845a34</EPAYMENT>

Inline response SHA2

<sig algo="sha256" date="20081117145935">cdd64ce75e6cf013a60291229c83063a5d903eae3bfa216e99aae8af65a055e8</sig>

Inline response SHA3

<sig algo="sha3-256" date="20081117145935">7fc19d21103ea56f1b413315fb3feb5fbdd137758623a73c7ed12d9bb84f21db</sig>

Last updated

Was this helpful?