validate
A helper method used internally by the SDK to perform minimal validation on the object before sending it to the server.
This method checks the following in order:
firstName is not empty
lastName is not empty
phone is not empty
phone is valid per PhoneValidator.isValid. The phone number string is stripped of any special characters before validation, using PhoneValidator.removeSpecialCharacters.
email is not empty
email is valid per EmailValidator.isValid.
address.postalCode is valid per ZipCodeValidator.isValid.
Return
A MissingInformationError with an error string identifying one of the above issues, or null if the object passes validation.