Skip to main content
knowledgecenter.avangate.com

LCN read receipt response for Avangate

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

Read receipt response for Avangate

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>

The parameters are as follows:

Parameters  

DATE

Date in the YmdGis format. (20081117145935)

HASH

HMAC_MD5 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_MD5 signature

Access 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_MD5 source string

103C343D0FAF102005-03-031420081117145935

Secret key

AABBCCDDEEFF

HMAC_MD5 signature

cb34fe2991668eb82364edf62f845a34

Inline response

<EPAYMENT>20081117145935|cb34fe2991668eb82364edf62f845a34</EPAYMENT>

Requirements

  1. Do not include HASH in the string needed for calculating the HMAC_MD5 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 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.