Skip to main content

Integrity Digest

The Integrity Digest lets you check that a payment result really came from Monek and hasn't been changed on the way, for example by a customer editing the query string on your SuccessUrl.

How it works​

  1. Send a secret. When your server creates the payment, through Prepared Payments or the Payments API, include an IntegritySecret that only you know.
  2. Receive a digest. Monek uses your secret to create an IntegrityDigest from the key result fields, and returns it with the result.
  3. Validate. Your server sends the result fields, the digest and your secret to IntegrityCheck.ashx. A 200 OK means the result is genuine.
warning

Only send IntegritySecret server to server, through Prepared Payments or the Payments API. A secret sent from a web page is ignored, and anyone could read it.

tip

If you use the same secret for every payment, rotate it regularly. You can also use a different secret for each payment.

Request field​

Field NameDescriptionReq'dSizeType
IntegritySecretA secret known only to you, used to create the IntegrityDigest.O50 max.A

Where the digest is returned​

When you send an IntegritySecret, the result includes an IntegrityDigest field:

Field NameDescriptionSizeType
IntegrityDigestA hash of key result fields, used to confirm the result is genuine and unmodified.50 max.A

It's returned with:

  • the redirect to your SuccessUrl or FailureUrl, and HTMLQS and XML responses
  • JSON responses
  • Transact Webhooks

Webhooks sent through Svix are signed differently. Verify those with the Svix signature instead. See Webhooks.

Validating the Integrity Digest​

Send a form-encoded HTTP POST to:

https://elite.monek.com/Secure/IntegrityCheck.ashx

Include these fields. Use the values from your original request and from the result exactly as you received them:

Field NameWhere to get itReq'dSizeType
IntegritySecretThe secret you sent with the paymentM50 max.A
IntegrityDigestThe digest returned with the resultM50 max.A
RequestTimeThe request time returned with the result. See the table below.M33 max.ISO 8601
IdempotencyTokenThe idempotency token you sent, if anyO50 max.A
PaymentReferenceThe payment reference you sent, if anyO50 max.A
CrossReferenceThe CrossReference returned with the resultM50 max.A
ResponseCodeThe 2-digit ResponseCode returned with the resultM2N
ResponseMessageThe Message returned with the resultM80 max.A
AmountThe amount you sent, in penceM10 max.N
CurrencyCodeThe currency code you sentM3N

Which time field to use​

The digest is created from the time of the original request, which has a different field name depending on how you received the result:

How you received the resultSend this value as RequestTime
Redirect, HTMLQS or XMLRequestTime
JSON responserequestDateTime. Not transactionDateTime, which is the time of the response.
Transact WebhooktransactionDateTime

Example​

POST /Secure/IntegrityCheck.ashx HTTP/1.1
Host: elite.monek.com
Content-Type: application/x-www-form-urlencoded

IntegritySecret=YOUR_SECRET&IntegrityDigest=RECEIVED_DIGEST&RequestTime=2026-11-04T10%3A11%3A12.4217561%2B00%3A00&PaymentReference=ORDER-0001&CrossReference=240401101112457459X2R&ResponseCode=00&ResponseMessage=AUTHCODE%3A457459&Amount=2500&CurrencyCode=826

Result​

HTTP statusMeaning
200 OKThe digest matches. The result is genuine.
400 Bad RequestThe digest doesn't match, or a required field is missing or wrong. Don't trust the result.
500 Internal Server ErrorThe check couldn't be completed. Try again before trusting the result.