diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/webhooks.js | 8 |
1 files changed, 6 insertions, 2 deletions
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); |
