public PaymentEventsService(
            IPaymentsEventsApiClient paymentsEventsApi,
            IPaymentEventMapper mapper,
            ILog logger)
        {
            if (paymentsEventsApi == null)
            {
                throw new ArgumentNullException(nameof(paymentsEventsApi));
            }
            if (mapper == null)
            {
                throw new ArgumentNullException(nameof(mapper));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            _paymentsEventsApi = paymentsEventsApi;
            _mapper            = mapper;
            _logger            = logger;
            _retryPolicy       = Policy
                                 .Handle <Exception>()
                                 .RetryAsync(3,
                                             (exception, retryCount) =>
            {
                _logger.Warn($"Error connecting to Payment Event Api: ({exception.Message}). Retrying...attempt {retryCount})");
            }
                                             );
        }
 public PaymentEventsDocumentSerivce(
     string storageConnectionString,
     IPaymentEventMapper mapper,
     ILog logger)
 {
     // ToDo: Move azure storage to separate file?
     _storageConnectionString = storageConnectionString;
     _mapper = mapper;
     _logger = logger;
 }
        public PaymentEventsDocumentService(
            IAzureBlobStorage azureBlobStorage,
            IPaymentEventMapper mapper,
            ILog logger)
        {
            _azureBlobStorage = azureBlobStorage;
            _mapper           = mapper;
            _logger           = logger;

            // todo: don't want to leak key - need a method to produce a safe-to-log value from the connection string
            //_logger.Info($"{nameof(PaymentEventsDocumentService)} is using {_azureBlobStorage.StorageConnectionString}");
        }