diff options
| author | Adam Soltys <[email protected]> | 2021-08-11 19:53:07 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-08-11 19:53:07 -0700 |
| commit | e07f1fa6e4fecb146e8cc4be45811ddbba7a7210 (patch) | |
| tree | 92661adfe9b56f78c756b0b6fede0afdf85f2639 | |
| parent | 6510e2e72adc107fb6fb341c8dd4641f84586634 (diff) | |
| download | coinos-server-e07f1fa6e4fecb146e8cc4be45811ddbba7a7210.tar.gz coinos-server-e07f1fa6e4fecb146e8cc4be45811ddbba7a7210.zip | |
pass asset and webhook secret
| -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); |
