From e07f1fa6e4fecb146e8cc4be45811ddbba7a7210 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 11 Aug 2021 19:53:07 -0700 Subject: pass asset and webhook secret --- lib/webhooks.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/webhooks.js b/lib/webhooks.js index f21607fb..86e1a07b 100644 --- a/lib/webhooks.js +++ b/lib/webhooks.js @@ -8,19 +8,23 @@ callWebhook = (invoice, payment) => { let { address, text, webhook } = invoice; if (webhook) { - let { amount, confirmed, hash, memo } = payment; + let { amount, confirmed, hash, memo, account } = payment; + let { asset } = account; + let secret = config.webhooks[webhook]; l.info("calling webhook", webhook); return wretch() + .headers({ "x-webhook": secret }) .url(webhook) .post({ address, + asset, amount, hash, memo, confirmed, text, - webhook + webhook, }) .json() .catch(console.log); -- cgit v1.2.3