From 7bd763fdf4e2852f758a709ee7e574542aaabeee Mon Sep 17 00:00:00 2001 From: DhananjayPurohit Date: Fri, 16 Aug 2024 14:17:49 +0530 Subject: [PATCH] fix: extract hash from decoded invoice --- clients/libs/web/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/libs/web/main.js b/clients/libs/web/main.js index 6418940f..a994148e 100644 --- a/clients/libs/web/main.js +++ b/clients/libs/web/main.js @@ -132,9 +132,9 @@ const verifyInvoice = async (clientConfig, batchId, paymentRequest) => { const decodedInvoice = await decodeInvoice(paymentRequest); let paymentHash = await getPaymentHash(clientConfig, batchId); - console.log("Decoded Invoice: ", decodedInvoice); - - return paymentHash === decodedInvoice.tagsObject.payment_hash; + + const paymentHashFromInvoice = invoiceData.tags.find(tag => tag.tagName === "payment_hash")?.data; + return paymentHash === paymentHashFromInvoice; } export default {