aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/webhooks.js52
1 files changed, 26 insertions, 26 deletions
diff --git a/lib/webhooks.js b/lib/webhooks.js
index 51a9a99e..4741932a 100644
--- a/lib/webhooks.js
+++ b/lib/webhooks.js
@@ -4,34 +4,34 @@ import { l } from "$lib/logging";
export const callWebhook = async (invoice, payment) => {
try {
- if (!invoice || !payment) return;
+ if (!invoice || !payment) return;
- let { address, received, text, webhook } = invoice;
+ let { address, received, text, webhook } = invoice;
- if (webhook) {
- let { amount, confirmed, hash, memo, account } = payment;
- let { asset } = account;
- let secret = config.webhooks[webhook];
+ if (webhook) {
+ let { amount, confirmed, hash, memo, account } = payment;
+ let { asset } = account;
+ let secret = config.webhooks[webhook];
- l("calling webhook", webhook, amount, hash, address, text);
- let res = await wretch()
- .headers({ "x-webhook": secret })
- .url(webhook)
- .post({
- address,
- amount,
- asset,
- confirmed,
- hash,
- memo,
- received,
- text,
- webhook
- })
- .res()
- return res;
+ l("calling webhook", webhook, amount, hash, address, text);
+ let res = await wretch()
+ .headers({ "x-webhook": secret })
+ .url(webhook)
+ .post({
+ address,
+ amount,
+ asset,
+ confirmed,
+ hash,
+ memo,
+ received,
+ text,
+ webhook
+ })
+ .res();
+ return res;
+ }
+ } catch (e) {
+ console.log("problem calling webhook", e);
}
- } catch(e) {
- console.log("problem calling webhook", e)
- }
};