diff --git a/addons/payment_authorize/static/src/js/payment_form.js b/addons/payment_authorize/static/src/js/payment_form.js index aab561066d7..06a74af31ed 100644 --- a/addons/payment_authorize/static/src/js/payment_form.js +++ b/addons/payment_authorize/static/src/js/payment_form.js @@ -13,6 +13,23 @@ PaymentForm.include({ // Private //-------------------------------------------------------------------------- + /** + * Returns the parameters for the AcceptUI button that AcceptJS will use. + * + * @private + * @param {Object} formData data obtained by getFormData + * @returns {Object} params for the AcceptJS button + */ + _acceptJsParams: function (formData) { + return { + 'class': 'AcceptUI d-none', + 'data-apiLoginID': formData.login_id, + 'data-clientKey': formData.client_key, + 'data-billingAddressOptions': '{"show": false, "required": false}', + 'data-responseHandler': 'responseHandler' + }; + }, + /** * called when clicking on pay now or add payment event to create token for credit card/debit card. * @@ -84,14 +101,7 @@ PaymentForm.include({ }; if (this.$button === undefined) { - var params = { - 'class': 'AcceptUI d-none', - 'data-apiLoginID': formData.login_id, - 'data-clientKey': formData.client_key, - 'data-billingAddressOptions': '{"show": false, "required": false}', - 'data-responseHandler': 'responseHandler' - }; - this.$button = $('