From 94e06a3a6b5fc49ac1c650f4e68db6d0782c6bac Mon Sep 17 00:00:00 2001 From: softsimon Date: Tue, 13 Oct 2020 18:26:10 +0700 Subject: [PATCH] Add notice for BTCpay invoices and requests. refs #135 --- backend/src/api/donations.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/api/donations.ts b/backend/src/api/donations.ts index 20e669bbb..63de49840 100644 --- a/backend/src/api/donations.ts +++ b/backend/src/api/donations.ts @@ -20,6 +20,8 @@ class Donations { } createRequest(amount: number, orderId: string): Promise { + logger.notice('New invoice request. Handle: ' + orderId + ' Amount: ' + amount + ' BTC'); + const postData = { 'price': amount, 'orderId': orderId, @@ -46,12 +48,11 @@ class Donations { } async $handleWebhookRequest(data: any) { - logger.notice('Received BTCPayServer webhook data: ' + JSON.stringify(data)); if (!data || !data.id) { return; } - const response = await this.getStatus(data.id); + logger.notice(`Received BTCPayServer webhook. Invoice ID: ${data.id} Status: ${response.status} BTC Paid: ${response.btcPaid}`); if (response.status !== 'complete' && response.status !== 'confirmed' && response.status !== 'paid') { return; }