aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2021-08-11 19:53:07 -0700
committerAdam Soltys <[email protected]>2021-08-11 19:53:07 -0700
commite07f1fa6e4fecb146e8cc4be45811ddbba7a7210 (patch)
tree92661adfe9b56f78c756b0b6fede0afdf85f2639 /lib
parent6510e2e72adc107fb6fb341c8dd4641f84586634 (diff)
downloadcoinos-server-e07f1fa6e4fecb146e8cc4be45811ddbba7a7210.tar.gz
coinos-server-e07f1fa6e4fecb146e8cc4be45811ddbba7a7210.zip
pass asset and webhook secret
Diffstat (limited to 'lib')
-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);