We use cookies to optimize your user experience. All information shared with us through cookies is secure and covered by our data privacy obligations. To learn more, view our privacy policy.
KongaPay Logo
KongaPayDevelopers
DevelopersPayment GatewayHash Generation

Hash Generation

Every SDK transaction must include a server-generated SHA-512 hash.

Hash Formula

text
sha512("{{amount}}|{{public_key}}|{{reference}}")

If discount is supplied, append the exact JSON string used in the request.

text
sha512("{{amount}}|{{public_key}}|{{reference}}|{{discount_json}}")

Rules

  • amount is sent in minor units, for example 500000 for NGN 5,000.00.
  • reference must be unique per transaction.
  • public_key must be the Maker Checker integration public key.
  • Generate hashes in your backend, not in browser code.

Node.js Example

javascript
const crypto = require("crypto");

                function generateKongaPayHash({ amount, publicKey, reference, discount }) {
                  let plain = amount + "|" + publicKey + "|" + reference;
                  if (discount) plain += "|" + JSON.stringify(discount);
                  return crypto.createHash("sha512").update(plain).digest("hex");
                }