/// <summary> /// Determines whether a meta received in response is valid with the generated meta information. /// </summary> /// <param name="result">The meta information to validate.</param> /// <returns>A string array of invalid property names.</returns> /// <exception cref="ArgumentNullException"><paramref name="result"/> is null.</exception> public string[] Validate(OtpInfo result) { ValidateNull(result, nameof(result)); var errorProperties = new List <string>(5); if (!AadhaarNumberHash.Equals(result.AadhaarNumberHash, StringComparison.OrdinalIgnoreCase)) { errorProperties.Add(nameof(AadhaarNumberHash)); } if (RequestType != result.RequestType) { errorProperties.Add(nameof(RequestType)); } if (Timestamp != result.Timestamp) { errorProperties.Add(nameof(Timestamp)); } if (!AuaCodeHash.Equals(result.AuaCodeHash, StringComparison.OrdinalIgnoreCase)) { errorProperties.Add(nameof(AuaCodeHash)); } if (!SubAuaCodeHash.Equals(result.SubAuaCodeHash, StringComparison.OrdinalIgnoreCase)) { errorProperties.Add(nameof(SubAuaCodeHash)); } return(errorProperties.ToArray()); }
/// <summary> /// Determines whether a meta received in response is valid with the generated meta information. /// </summary> /// <param name="authInfo">The meta information to validate.</param> /// <returns>A string array of invalid property names.</returns> public string[] Validate(AuthInfo authInfo) { ValidateNull(authInfo, nameof(authInfo)); var errorProperties = new List <string>(6); if (!AadhaarNumberHash.Equals(authInfo.AadhaarNumberHash, StringComparison.OrdinalIgnoreCase)) { errorProperties.Add(nameof(AadhaarNumberHash)); } if (!DemographicHash.Equals(authInfo.DemographicHash, StringComparison.OrdinalIgnoreCase)) { errorProperties.Add(nameof(DemographicHash)); } if (Timestamp != authInfo.Timestamp) { errorProperties.Add(nameof(Timestamp)); } if (!AuaCodeHash.Equals(authInfo.AuaCodeHash, StringComparison.OrdinalIgnoreCase)) { errorProperties.Add(nameof(AuaCodeHash)); } if (!SubAuaCode.Equals(authInfo.SubAuaCode)) { errorProperties.Add(nameof(SubAuaCode)); } if (!TerminalHash.Equals(authInfo.TerminalHash, StringComparison.OrdinalIgnoreCase)) { errorProperties.Add(nameof(TerminalHash)); } return(errorProperties.ToArray()); }
/// <summary> /// Determines whether a meta received in response is valid with the generated meta information. /// </summary> /// <param name="result">The meta information to validate.</param> /// <returns>A string array of invalid property names.</returns> public string[] Validate(OtpInfo result) { ValidateNull(result, nameof(result)); var errorProperties = new List <string>(6); if (!AadhaarNumberHash.Equals(result.AadhaarNumberHash)) { errorProperties.Add(nameof(AadhaarNumberHash)); } if (Timestamp != result.Timestamp) { errorProperties.Add(nameof(Timestamp)); } if (!AuaCodeHash.Equals(result.AuaCodeHash)) { errorProperties.Add(nameof(AuaCodeHash)); } if (!SubAuaCode.Equals(result.SubAuaCode)) { errorProperties.Add(nameof(SubAuaCode)); } if (!MaskedMobile.Equals(result.MaskedMobile)) { errorProperties.Add(nameof(MaskedMobile)); } if (!MaskedEmail.Equals(result.MaskedEmail)) { errorProperties.Add(nameof(MaskedEmail)); } return(errorProperties.ToArray()); }