function validateBankAccountInputs (inputs) {
  const format = formatFieldValidationError;
  let errors = [];

  each(BANK_ACCOUNT_REQUIRED_FIELDS, function(field){
    if (!inputs[field]) {
      errors.push(format(field, BLANK));
    } else if (typeof inputs[field] !== 'string') {
      errors.push(format(field, INVALID));
    }
  });

  if (inputs.account_number !== inputs.account_number_confirmation) {
    errors.push(format('account_number_confirmation', DOES_NOT_MATCH));
  }

  debug('validate errors', errors);

  return errors;
}
/**
 * Checks user input on a bank account token call
 *
 * @param {Object} inputs
 * @return {Array} formatted array of invalid fields with descriptive messages
 */
Checks user input on a bank account token call
@param {Object} inputs
@return {Array} formatted array of invalid fields with descriptive messages
Checks user input on a bank account token call @param { Object } inputs @return { Array } formatted array of invalid fields with descriptive messages
function validateBankAccountInputs (inputs) {
  const format = formatFieldValidationError;
  let errors = [];
  each(BANK_ACCOUNT_REQUIRED_FIELDS, function(field){
    if (!inputs[field]) {
      errors.push(format(field, BLANK));
    } else if (typeof inputs[field] !== 'string') {
      errors.push(format(field, INVALID));
    }
  });
  if (inputs.account_number !== inputs.account_number_confirmation) {
    errors.push(format('account_number_confirmation', DOES_NOT_MATCH));
  }
  debug('validate errors', errors);
  return errors;
}
function validateBankAccountInputs ( inputs ) { const format = formatFieldValidationError ; let errors = [ ] ; each ( BANK_ACCOUNT_REQUIRED_FIELDS , function ( field ) { if ( ! inputs [ field ] ) { errors . push ( format ( field , BLANK ) ) ; } else if ( typeof inputs [ field ] !== 'string' ) { errors . push ( format ( field , INVALID ) ) ; } } ) ; if ( inputs . account_number !== inputs . account_number_confirmation ) { errors . push ( format ( 'account_number_confirmation' , DOES_NOT_MATCH ) ) ; } debug ( 'validate errors' , errors ) ; return errors ; }
Checks user input on a bank account token call
 @param {Object} inputs
 @return {Array} formatted array of invalid fields with descriptive messages
Checks user input on a bank account token call @param { Object } inputs @return { Array } formatted array of invalid fields with descriptive messages