{URL-Customer-Webhook}
Create a webhook to communicate with the alfred ecosystem to receive invoices
Description:
This endpoint is designed to communicate with alfred ecosystem to receive invoices for any "Pay Out" transactions.
Mode:
POST
Node:
Considerations:
In order to confirm a signature authorizing a transaction, the signature and invoice date must be validated with the following algorithm:
Algorithm:
const crypto = require('crypto');
function encryptData(data) {
const dataBuffer = Buffer.from(data, "utf8");
const secretKeyBytes = Buffer.from("secret", "base64");
const hmac = crypto.createHmac("sha256", secretKeyBytes);
hmac.update(dataBuffer);
const encryptedData = hmac.digest("base64");
return encryptedData;
}
const dataToEncrypt = "2023-09-25 13:48:20.890-0400d9b3146b-24e0-447089621b56125086bb";
const encryptedData = encryptData(dataToEncrypt);
console.log(encryptedData);
Last updated