diff --git a/src/apps/myaccount/submodules/ach/ach.js b/src/apps/myaccount/submodules/ach/ach.js index 7ec1d649d..37aded6ed 100644 --- a/src/apps/myaccount/submodules/ach/ach.js +++ b/src/apps/myaccount/submodules/ach/ach.js @@ -274,6 +274,14 @@ define(function(require) { container = args.container, data = args.data, bankData = data.bankData, + parseAmount = function parseAmount(value) { + var splitAmount = _.split(value, '.'), + integer = _.trimStart(splitAmount[0], '0'), + cents = splitAmount.length === 1 ? '00' : _.padEnd(splitAmount[1], 2, '0'), + amount = integer + cents; + + return _.parseInt(amount); + }, appendTemplate = function appendTemplate() { var template = $(self.getTemplate({ name: 'ach-section-verification', @@ -304,6 +312,12 @@ define(function(require) { enableVerifyButton(); }; + template + .find('input[type="text"]') + .mask('#0.00', { + reverse: true + }); + //set validation to false on load _.each(self.appFlags.ach.validAchVerificationFormFields, (value, key) => { self.appFlags.ach.validAchVerificationFormFields[key] = false; @@ -356,13 +370,16 @@ define(function(require) { next(null); }, function confirmMicroDeposits(next) { + var depositAmount1 = parseAmount(verificationAmounts.deposit_amount_1), + depositAmount2 = parseAmount(verificationAmounts.deposit_amount_2); + self.confirmMicroDeposits({ data: { verificationId: _.get(bankData, 'verification_id'), data: { deposits: [ - Math.floor(verificationAmounts.deposit_amount_1 * 100), - Math.floor(verificationAmounts.deposit_amount_2 * 100) + depositAmount1, + depositAmount2 ] } }, diff --git a/src/apps/myaccount/submodules/ach/views/ach-section-verification.html b/src/apps/myaccount/submodules/ach/views/ach-section-verification.html index ae80de5d9..7c018842e 100644 --- a/src/apps/myaccount/submodules/ach/views/ach-section-verification.html +++ b/src/apps/myaccount/submodules/ach/views/ach-section-verification.html @@ -36,13 +36,13 @@
- +
- +