Fixed key values for fn_pay.js
Some checks failed
Workflow push to Dappbundle / Build (push) Has been cancelled

This commit is contained in:
Vivek Teega 2024-10-08 00:14:18 +05:30
parent 14a2cae44e
commit e5a7d1ddc0

View File

@ -292,25 +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"){
debugger
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 (parsedTxData.sender !== sender){
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){
else if (parsedTxData.receiver !== myFloID)
reject([true, "Incorrect receiverID: " + parsedTxData.receive])
}
else {
resolve(true);
}
else resolve(true);
}).catch(error => reject([null, error]))
})
}