aboutsummaryrefslogtreecommitdiffstats
path: root/lib/webhooks.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-08-12 13:27:47 -0700
committerAdam Soltys <[email protected]>2021-08-12 13:27:47 -0700
commit683cb1c1c8e5ed0fa5e9fdc9aafb3cf1bd086860 (patch)
tree65a9c9466e23a450e5fb07807b3073018afb7803 /lib/webhooks.js
parentda864d3ae0f6ad2c81e6b676735e5381f6df815c (diff)
parent30598010bf13159b62ef77fde9c3338bb405f270 (diff)
downloadcoinos-server-683cb1c1c8e5ed0fa5e9fdc9aafb3cf1bd086860.tar.gz
coinos-server-683cb1c1c8e5ed0fa5e9fdc9aafb3cf1bd086860.zip
Merge branch 'master' into dev
Diffstat (limited to 'lib/webhooks.js')
-rw-r--r--lib/webhooks.js8
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);