public static void ValidatePhoneNumber(this MpesaClient mpesaClient, string phoneNummber) { LengthValidator.ValidateLength(phoneNummber, "PhoneNumber", 12); if (!phoneNummber.StartsWith("2547")) { throw new Exception("Invalid phone number"); } }
public static void ValidateBusinessShortCode(this MpesaClient mpesaClient, string code) { NumericValidator.ValidateIsNumeric(code, "BusinessShortCode"); LengthValidator.ValidateLength(code, "BusinessShortCode", 13, 5); }