Skip to main content

IPN read receipt response for 2Checkout

IPN read receipt response for 2Checkout

Last updated: 29-Jul-2024
Rate this article:

Overview

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

Read receipt response from 2Checkout

The read receipt response is required in the IPN response body, unlike the previous hash string which is optional, with the EPAYMENT tag. We use this hash as a method of security.

To validate the success of the notification process, insert an inline response in the script output of your IPN listener. 2Checkout expects the following format:

<sig algo="sha256" date="DATE">HASH</sig>

   Note:  Possible values for algo: sha256, sha3-256.

Once 2Checkout validates that the above format is part of the response it considers the IPN successful. Otherwise, 2Checkout continues to send notifications per the failure recovery process until you provide a valid response.

DATE Datetime stamp. YmdHis. (20081117145935)
HASH

Calculate the HMAC_SHA signature using:

  • IPN_PID[0]
  • IPN_PNAME[0]
  • IPN_DATE
  • DATE
  • Your account’s secret key

HASH fields values are case insensitive.

The fields used in the HMAC_SHA signature are captured from the IPN payload just received, in the same order:

Field name Description
IPN_PID[0] First product ID from the IPN_PID[] array.
IPN_PNAME[0] First product name from the IPN_PNAME[] array.
IPN_DATE IPN date in the YmdHis format (ex: 20081117145935)
DATE Response issuing date (server time) in the YmdHis format (ex: 20081117145935)

For the example parameters included in this article, build the response using shorter data formats for date values. Use only the following values, in the same order, for the HMAC source string:

Field name Length Field value
IPN_PID[0] 1 1
IPN_PNAME[0] 16 Software program
IPN_DATE 14 20050303123434
DATE 14 20050303123434

Therefore, the HMAC source string is:

1116Software program14200503031234341420050303123434

while the HMAC SHA-2 string is: 

ea6f44c39b3d204b59500998fcb9221c92744d9721a94b45fc6d5cda99980176

and the HMAC SHA-3 string is:

85180497aaaa4844a278b52b1ce257d2820dbf5857470a5f678fef2266d0d4a8

Configure the response to output anywhere on the page defined as the IPN URL for:

  • SHA-2:
<sig algo="sha256" date="20050303123434">ea6f44c39b3d204b59500998fcb9221c92744d9721a94b45fc6d5cda99980176</sig>
  • SHA-3:
<sig algo="sha3-256" date="20050303123434">85180497aaaa4844a278b52b1ce257d2820dbf5857470a5f678fef2266d0d4a8</sig>

2Checkout checks the string’s validity and marks notifications as "successfully sent" in the 2Checkout system. Otherwise, 2Checkout resends the IPN notifications at specific time intervals described in the failure recovery process section, until successfully confirmed. Also, 2Checkout displays an error notification in the Dashboard area of your Merchant Control Panel.

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