public static bool IsAccountNameValid(string playerAccountName, Common.Data.Player.Player player) { return(string.Equals(playerAccountName, player.FirstName + " " + player.LastName, StringComparison.InvariantCultureIgnoreCase) || string.Equals(playerAccountName, player.LastName + " " + player.FirstName, StringComparison.InvariantCultureIgnoreCase) || string.Equals(playerAccountName, player.FirstName, StringComparison.InvariantCultureIgnoreCase)); }
private static void ValidatePlayersSetting(IdentificationDocumentSettings setting, Common.Data.Player.Player player) { if (setting.IdFront) { var uploading = player.IdentityVerifications .FirstOrDefault(o => o.DocumentType == DocumentType.Id && o.VerificationStatus == VerificationStatus.Verified); if (uploading == null || uploading.FrontFile == null) { throw new Exception("Player's identification documents doesn't match configured criteria"); } } if (setting.IdBack) { var uploading = player.IdentityVerifications .FirstOrDefault(o => o.DocumentType == DocumentType.Id && o.VerificationStatus == VerificationStatus.Verified); if (uploading == null || uploading.BackFile == null) { throw new Exception("Player's identification documents doesn't match configured criteria"); } } if (setting.CreditCardFront) { var uploading = player.IdentityVerifications .FirstOrDefault(o => o.DocumentType == DocumentType.CreditCard && o.VerificationStatus == VerificationStatus.Verified); if (uploading == null || uploading.FrontFile == null) { throw new Exception("Player's identification documents doesn't match configured criteria"); } } if (setting.CreditCardBack) { var uploading = player.IdentityVerifications .FirstOrDefault(o => o.DocumentType == DocumentType.CreditCard && o.VerificationStatus == VerificationStatus.Verified); if (uploading == null || uploading.BackFile == null) { throw new Exception("Player's identification documents doesn't match configured criteria"); } } if (setting.POA) { var uploading = player.IdentityVerifications .FirstOrDefault(o => o.DocumentType == DocumentType.POA && o.VerificationStatus == VerificationStatus.Verified); if (uploading == null || uploading.FrontFile == null) { throw new Exception("Player's identification documents doesn't match configured criteria"); } } if (setting.DCF) { var uploading = player.IdentityVerifications .FirstOrDefault(o => o.DocumentType == DocumentType.DCF && o.VerificationStatus == VerificationStatus.Verified); if (uploading == null || uploading.FrontFile == null) { throw new Exception("Player's identification documents doesn't match configured criteria"); } } }