Method Normalize
Normalize(String)
Attempts to normalise a string containing a phone number to a form that can be used as a payer id.
Declaration
public string Normalize(string userInput)
Parameters
Type | Name | Description |
---|---|---|
System.String | userInput | A string containing a phone number. |
Returns
Type | Description |
---|---|
System.String | A new string containing the normalised form of the phone number. |
Implements
Remarks
This method will remove non-numeric characters commonly used in phone numbers (+ ( ) - etc) as well as whitespace in the string provided. The result is validated via the IsValid(String) method before being returned, and if invalid an exception is thrown.
This method will also attempt to convert international numbers (i.e those starting with +642x or 642x) to local numbers.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
System.ArgumentException | Thrown if |
OnlineEftposInvalidDataException | Thrown if the converted |