From f7250550d0661acbc4e1832acdbd7637da7c1949 Mon Sep 17 00:00:00 2001 From: Joren Van Onder Date: Wed, 10 Nov 2021 14:55:06 +0000 Subject: [PATCH] [FIX] payment_authorize: don't error on long account names The maximum length for nameOnAccount is 22 characters [1]. Entering a longer name results in an unclear error message: Server Error We are not able to process your payment. E_WC_26: Please provide valid account holder name. A maxlength="22" on the input was considered as well, but it would be confusing for users and bank transactions with the first 22 characters should be accepted. opw-2688384 [1] https://developer.authorize.net/api/reference/features/acceptjs.html closes odoo/odoo#79950 X-original-commit: 64b86f36264c2e655681c7b6bed69e89891107bf Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: jorenvo --- addons/payment_authorize/static/src/js/payment_form.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment_authorize/static/src/js/payment_form.js b/addons/payment_authorize/static/src/js/payment_form.js index 3df283dd70e..722a22b596f 100644 --- a/addons/payment_authorize/static/src/js/payment_form.js +++ b/addons/payment_authorize/static/src/js/payment_form.js @@ -60,7 +60,7 @@ odoo.define('payment_authorize.payment_form', require => { } else { return { bankData: { - nameOnAccount: inputs.accountName.value, + nameOnAccount: inputs.accountName.value.substring(0, 22), // Max allowed by acceptjs accountNumber: inputs.accountNumber.value, routingNumber: inputs.abaNumber.value, accountType: inputs.accountType.value,