From bc089c7d6bb5282c93ab34ab9bcc0a17c4206889 Mon Sep 17 00:00:00 2001 From: RanchiMall Dev Date: Tue, 8 Oct 2024 06:24:44 +0000 Subject: [PATCH] Workflow updating files of flopay --- flopay/scripts/fn_pay.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/flopay/scripts/fn_pay.js b/flopay/scripts/fn_pay.js index ffadc6a..6e1c349 100644 --- a/flopay/scripts/fn_pay.js +++ b/flopay/scripts/fn_pay.js @@ -292,17 +292,20 @@ Cashier.checkIfTokenTxIsValid = function (tokenTxID, sender, amount) { floTokenAPI.getTx(tokenTxID).then(tx => { let parsedTxData = floTokenAPI.util.parseTxData(tx); console.debug(parsedTxData); - if (parsedTxData.type !== "transfer" || parsedTxData.transferType !== "token") + + if (tx.type !== "transfer" || tx.transferType !== "token") reject([true, "Invalid token transfer type"]); - else if (parsedTxData.tokenAmount !== amount) - reject([true, "Incorrect token amount: " + parsedTxData.tokenAmount]); - else if (parsedTxData.tokenIdentification !== floGlobals.currency) - reject([true, "Incorrect token: " + parsedTxData.tokenIdentification]); + else if (tx.tokenAmount !== amount) + reject([true, "Incorrect token amount: " + tx.tokenAmount]); + else if (tx.tokenIdentification !== floGlobals.currency) + reject([true, "Incorrect token: " + tx.tokenIdentification]); else if (parsedTxData.sender !== sender) reject([true, "Incorrect senderID: " + parsedTxData.sender]); else if (parsedTxData.receiver !== myFloID) reject([true, "Incorrect receiverID: " + parsedTxData.receive]) else resolve(true); + + }).catch(error => reject([null, error])) }) } \ No newline at end of file