示例#1
0
 public ManageLevyAccountBalanceService(IAccountApiClient accountApiClient,
                                        IPaymentLogger logger,
                                        ILevyAccountBulkCopyRepository levyAccountBulkWriter,
                                        ILevyFundingSourceRepository levyFundingSourceRepository,
                                        int batchSize,
                                        IEndpointInstanceFactory endpointInstanceFactory)
 {
     this.accountApiClient            = accountApiClient ?? throw new ArgumentNullException(nameof(accountApiClient));
     this.logger                      = logger ?? throw new ArgumentNullException(nameof(logger));
     this.levyAccountBulkWriter       = levyAccountBulkWriter ?? throw new ArgumentNullException(nameof(levyAccountBulkWriter));
     this.levyFundingSourceRepository = levyFundingSourceRepository ?? throw new ArgumentNullException(nameof(levyFundingSourceRepository));
     this.batchSize                   = batchSize;
     this.endpointInstanceFactory     = endpointInstanceFactory ?? throw new ArgumentNullException(nameof(endpointInstanceFactory));
 }
        public ManageLevyAccountBalanceService(ILevyFundingSourceRepository repository,
                                               IAccountApiClient accountApiClient,
                                               IPaymentLogger logger,
                                               ILevyAccountBulkCopyRepository levyAccountBulkWriter,
                                               int batchSize,
                                               IEndpointInstanceFactory endpointInstanceFactory)
        {
            this.repository              = repository;
            this.accountApiClient        = accountApiClient;
            this.logger                  = logger;
            this.levyAccountBulkWriter   = levyAccountBulkWriter;
            this.batchSize               = batchSize;
            this.endpointInstanceFactory = endpointInstanceFactory;

            retryPolicy = Policy.Handle <Exception>().WaitAndRetryAsync(5, i => TimeSpan.FromMinutes(1));
        }