Payment Webhook

{
  "type": "abeg-transfer.success",
  "uuid": "xxxxxxxxx-38d6-4bab-xxxx-xxxxxxxxxxx",
  "amount": 20000,
  "actual_amount": 20000,
  "settled_amount": 19900,
  "description": "Transfer from Abeg",
  "fees": 100,
  "paypoint": false,
  "customer": {
    "uuid": "xxxxxxxxx-38d6-4bab-xxxx-xxxxxxxxxxx",
    "avatar": "https://storage.googleapis.com/abeg/avatar/xxxx.jpg",
    "name": "Adio Azeez",
    "email": "[email protected]",
    "phone": "091xxxxxxxx",
    "bvn": "xxxxxxxxxx",
    "tag": "adxvi",
    "frequency": 1
  },
  "meta": {
    "abeg_tag": "adxvi",
    "name": "Adio Azeez"
  }
}

Webhook Verification

Sign the signature

Authenticate the signed header by getting the signature hash and hashing the stringified request body as a HMAC salt

const myHash = crypto
			.createHmac("sha512", `${LIVE_PATRONIZE_MERCHANT_APIKEY}`)
			.update(JSON.stringify({request body}))
			.digest("hex");

    const signature = req.headers["x-patronize-signature"];

Verify Webhook

curl --location --request GET 'https://patronize-api-production-dot-patronizeng.ew.r.appspot.com/api/v1/transaction/7652a72e-6268-458a-a73f-44c4a7e57e8f' \
--header 'Authorization: Bearer key_{merchant apikey}'