Skip to main content

LCN read receipt response for 2Checkout

LCN read receipt response for 2Checkout

Last updated: 19-Feb-2024
Rate this article:

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.

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.

Field name

Field length

Field value

FIRSTNAME

4

John

LASTNAME

5

Smith

COMPANY

0

 

EMAIL

19

johnsmith@email.com

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>

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.
Rate this article:

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo