Validation (4.10.3)

Learn all about Validation using Recurly.js version 4.10.3.

Validation

Recurly.js bundles a few helpful methods for validating payment information prior to processing. These methods are used when generating tokens, but you can also use them to enhance your form validations and checkout flow.

It is also possible to inspect the validation state of hosted fields as your customer types, by listening to the 'change' event.

Reference

recurly.bankAccount.bankInfo

Retrieves bank info based from a given routing number.

recurly.bankAccount.bankInfo({ routingNumber: '123456780' }, function (err, bankInfo) {
  if (err) {
    // err.code, err.message
  } else {
    // bankInfo.bank_name
  }
});

Arguments

ParamTypeDescription
optionsObject
options.routingNumberStringThe routing number for a bank (ex: '123456780')
callbackFunction

Callback signature

ParamTypeDescription
errRecurlyError or undefinedError. Usually invalid-routing-number
bankInfoObject
bankInfo.bank_nameStringBank institution name (ex: Bank of Recurly)