There is a slight issue I am facing. Whenever I input a new transfer of 269 euros with the bank account number BE072750044-35066, a confirmation code is required. The code to be entered is 350269
.
https://i.stack.imgur.com/YVkPc.png
The digits 350
correspond to the last 5 numbers of the bank account -> BE072750044-35066.
And the 269 indicates the amount for the new transfer.
For instance, if the transfer amount was 350 euros, then we would have 350350
.
https://i.stack.imgur.com/VWISv.png
However, a challenge arises in case the bank account includes a letter at the end like FR5940802053780006178110K61.
The concern is that it retrieves 10K269
, whereas the user must only enter numerical values on the digipass.
How can this issue be resolved for the user?
https://i.stack.imgur.com/op13P.png
getTokenTwoAdd(nt) {
var partOne, partTwo, absoluteAmount;
partOne = (nt.iban.substr(nt.iban.length - 5)).substring(0, 3);
absoluteAmount = Math.abs(nt.amount);
absoluteAmount = parseInt(absoluteAmount);
partTwo = ((absoluteAmount < 100) ? this.helpers.addLeadingZeroesLeft(absoluteAmount, 3) : absoluteAmount) + "";
partTwo = partTwo.substring(0, 3);
console.log("Iban number, slice => " + partOne);
console.log("Iban number => " + nt.iban);
console.log("Amount => " + absoluteAmount);
return partOne + partTwo;
}
The variable partOne
denotes the bank account number slice
The variable nt.iban
represents the account bank number
The variable absoluteAmount
signifies the transfer amount