public async Task <bool> IsValidAsync(AWSMessageResponse.SqsResponse message) { if (message == null) { return(true); } try { var gatewayResponse = await _proxy.EmailInfo(message.EmailAddress); if (gatewayResponse.Disposable || gatewayResponse.Recent_abuse || gatewayResponse.Suspect || gatewayResponse.Honeypot || gatewayResponse.Deliverability.ToLowerInvariant() == "low" || (!gatewayResponse.Valid)) { return(false); } return(gatewayResponse.Overall_score == 4 && gatewayResponse.Smtp_score == 3); } catch (Exception) { throw; } }
public async Task <bool> IsValidAsync(AWSMessageResponse.SqsResponse message) { if (message == null) { return(true); } try { var gatewayResponse = await _proxy.CpfInfo(message.UserDocument); var cpfStatus = gatewayResponse.Situacao.Codigo; return(cpfStatus == SituacaoCadastral.Regular || cpfStatus == SituacaoCadastral.DefaultValue); } catch (Exception) { throw; } }
public async Task Action(AWSMessageResponse.SqsResponse messageToPublish, bool everythinIsFine) { var message = messageToPublish.ToMessageToPublish(everythinIsFine); var request = new PublishRequest(_publishConfiguration.UserOnBoardingAccount, message.ToJson()); await _snsClient.PublishAsync(request); }
public MessageToPublish(AWSMessageResponse.SqsResponse response, bool everythingIsFine) { _response = response; EverythingIsFine = everythingIsFine; }
public static Publish.Model.MessageToPublish ToMessageToPublish(this AWSMessageResponse.SqsResponse response, bool everythingIsFine) => new Publish.Model.MessageToPublish(response, everythingIsFine);