HelcimPay.js Validation

This reference details the steps for validating the transaction performed in the HelcimPay.js Implementation process.

To ensure the integrity of the transaction response, it can be validated by comparing the hash generated from the response data and the secret token to the hash received in the response.

Example response data:

data: {
  amount: "100.00",
  approvalCode: "T5E5ST",
  avsResponse: "X",
  cardBatchId: "2578965",
  cardHolderName: "Jane Doe",
  cardNumber: "5454545454",
  cardToken: "684a4a03400fadd1e7bdc9",
  currency: "CAD",
  customerCode: "CST1200",
  dateCreated: "2022-01-05 12:30:45",
  invoiceNumber: "INV000010",
  status: "APPROVED",
  transactionId: "17701631",
  type: "purchase"
hash: "dbcb570cca52c38d597941adbed03f01be78c43cba89048722925b2f168226a9"

The hash from the response is created by first JSON encoding the transaction response data, then appending it with the secret token received during HelcimPay.js Initialization request, and finally, generating a secure and unique hash using the SHA-256 algorithm.

Example hash implementation:

hash('sha256', $jsonEncodedData . $secretToken);