/// <summary>
 /// Creates a new instance of the TransactionRegistrar
 /// </summary>
 public TransactionRegistrar(Configuration configuration, IHttpRequestSender requestSender)
 {
     this.configuration = configuration;
     this.requestSender = requestSender;
     this.serializer = new HttpPostSerializer();
     this.deserializer = new ResponseSerializer();
 }
 public TransactionManager(SagePaySettings sagePaySettings,
                             IHttpRequestSender httpRequestSender,
                             ITransactionRegistrationBuilder transactionRegistrationBuilder)
 {
     _sagePaySettings = sagePaySettings;
     _httpRequestSender = httpRequestSender;
     _transactionRegistrationBuilder = transactionRegistrationBuilder;
 }
        private IProviderServiceValidator GetSubject()
        {
            _mockResponseComparer = Substitute.For<IProviderServiceResponseComparer>();
            _mockHttpRequestSender = Substitute.For<IHttpRequestSender>();
            _mockReporter = Substitute.For<IReporter>();

            return new ProviderServiceValidator(_mockResponseComparer, _mockHttpRequestSender, _mockReporter);
        }
 public ProviderServiceValidator(
     IHttpRequestSender httpRequestSender, 
     IReporter reporter) : this(
     new ProviderServiceResponseComparer(reporter),
     httpRequestSender,
     reporter)
 {
 }
 internal ProviderServiceValidator(
     IProviderServiceResponseComparer providerServiceResponseComparer,
     IHttpRequestSender httpRequestSender, 
     IReporter reporter)
 {
     _providerServiceResponseComparer = providerServiceResponseComparer;
     _httpRequestSender = httpRequestSender;
     _reporter = reporter;
 }
 public ProviderServiceValidator(
     IHttpRequestSender httpRequestSender,
     IReporter reporter,
     PactVerifierConfig config)
     : this(new ProviderServiceResponseComparer(),
     httpRequestSender,
     reporter,
     config)
 {
 }
 internal ProviderServiceValidator(
     IProviderServiceResponseComparer providerServiceResponseComparer,
     IHttpRequestSender httpRequestSender,
     IReporter reporter,
     PactVerifierConfig config)
 {
     _providerServiceResponseComparer = providerServiceResponseComparer;
     _httpRequestSender = httpRequestSender;
     _reporter = reporter;
     _config = config;
 }
        public HttpProxyHandlerFactory(IHttpParser parser, IHttpRequestSender requestSender, IHashProvider hashProvider, ICache<string, byte[]> cache, IRequestLogger requestLogger)
        {
            Requires.NotNull(parser, "parser");
            _parser = parser;

            Requires.NotNull(requestSender, "requestSender");
            _requestSender = requestSender;

            Requires.NotNull(hashProvider, "hashProvider");
            _hashProvider = hashProvider;

            Requires.NotNull(cache, "cache");
            _cache = cache;

            Requires.NotNull(requestLogger, "requestLogger");
            _requestLogger = requestLogger;
        }
 public InvalidBlocksService(IHttpRequestSender requestSender)
 {
     _requestSender = requestSender;
 }
 public AusPostProvider(IHttpRequestSender requestSender = null)
 {
     _requestSender = requestSender ?? new HttpRequestSender();
 }
Exemple #11
0
 internal TokenFetchingRequestSender(AccessTokenService accessTokenService, IHttpRequestSender underlyingRequestSender)
 {
     _accessTokenService = accessTokenService;
     _requestSender      = underlyingRequestSender;
 }
 public ValidatorService(IHttpRequestSender requestSender)
 {
     _requestSender = requestSender;
 }
Exemple #13
0
        public IPactVerifier ServiceProvider(string providerName, Func<ProviderServiceRequest, ProviderServiceResponse> httpRequestSender)
        {
            if (String.IsNullOrEmpty(providerName))
            {
                throw new ArgumentException("Please supply a non null or empty providerName");
            }

            if (!String.IsNullOrEmpty(ProviderName))
            {
                throw new ArgumentException("ProviderName has already been supplied, please instantiate a new PactVerifier if you want to perform verification for a different provider");
            }

            if (httpRequestSender == null)
            {
                throw new ArgumentException("Please supply a non null httpRequestSenderFunc");
            }

            ProviderName = providerName;
            _httpRequestSender = new CustomRequestSender(httpRequestSender);

            return this;
        }
 private Provisioner(IHttpRequestSender httpRequestSender)
 {
     this.httpRequestSender = httpRequestSender;
     ResetStatus();
 }
Exemple #15
0
 public ConnectionRequestService(IHttpRequestSender requestSender)
 {
     _requestSender = requestSender;
 }
 public TimeoutHandlingRequestSender(IHttpRequestSender wrappedRequestSender)
 {
     _wrappedRequestSender = wrappedRequestSender ?? throw new ArgumentNullException(nameof(wrappedRequestSender));
 }
 /// <summary>
 /// Creates a new instance of the TransactionRegistrar
 /// </summary>
 public TransactionRegistrar(Configuration configuration, IUrlResolver urlResolver, IHttpRequestSender requestSender)
 {
     this.configuration = configuration;
     this.requestSender = requestSender;
     this.urlResolver   = urlResolver;
 }
Exemple #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Sdk.Api.ApiRequestSender"/> class.
 /// </summary>
 /// <param name="configuration">Configuration.</param>
 /// <param name="credentials">Credentials to use in authorized requests and to refresh tokens</param>
 /// <param name="httpSender">HTTP instance to send API requests</param>
 internal ApiRequestSender(Configuration configuration, ICredentials credentials, IHttpRequestSender httpSender)
 {
     _configuration = configuration;
     _httpSender    = httpSender;
     _credentials   = credentials;
 }
Exemple #19
0
 public ZigNetApiHandler(IHttpRequestSender httpRequestSender, string zigNetApiUrl)
 {
     _httpRequestSender = httpRequestSender;
     _zigNetApiUrl      = zigNetApiUrl;
 }
 public ConfigService(IHttpRequestSender requestSender)
 {
     _requestSender = requestSender;
 }
Exemple #21
0
        public IPactVerifier ServiceProvider(string providerName, HttpClient httpClient)
        {
            if (String.IsNullOrEmpty(providerName))
            {
                throw new ArgumentException("Please supply a non null or empty providerName");
            }

            if (httpClient == null)
            {
                throw new ArgumentException("Please supply a non null httpClient");
            }

            ProviderName = providerName;
            _httpRequestSender = new HttpClientRequestSender(httpClient);
                
            return this;
        }
Exemple #22
0
        public IPactVerifier ServiceProvider(string providerName, Func<ProviderServiceRequest, ProviderServiceResponse> httpRequestSenderFunc)
        {
            if (String.IsNullOrEmpty(providerName))
            {
                throw new ArgumentException("Please supply a non null or empty providerName");
            }

            if (httpRequestSenderFunc == null)
            {
                throw new ArgumentException("Please supply a non null httpRequestSenderFunc");
            }

            ProviderName = providerName;
            _httpRequestSender = new CustomRequestSender(httpRequestSenderFunc);

            return this;
        }
Exemple #23
0
 public UpgradeNoticeService(IHttpRequestSender requestSender)
 {
     _requestSender = requestSender;
 }
        public HttpProxyHandler(IPAddress address, int port, IHttpParser parser, IHttpRequestSender requestSender, IHashProvider hashProvider, ICache<string, byte[]> cache, IRequestLogger requestLogger)
        {
            Requires.NotNull(parser, "parser");
            _parser = parser;

            Requires.NotNull(requestSender, "requestSender");
            _requestSender = requestSender;

            Requires.NotNull(hashProvider, "hashProvider");
            _hashProvider = hashProvider;

            Requires.NotNull(cache, "cache");
            _cache = cache;

            Requires.NotNull(requestLogger, "requestLogger");
            _requestLogger = requestLogger;

            _listener = new TcpListener(address, port);
            // _clientQueue = new ActionQueue<TcpClient>(Handle);

            _tokenSource = new CancellationTokenSource();
            _workingTask = new Task(Run, Token, TaskCreationOptions.LongRunning);
            _waitHandle = new AutoResetEvent(false);

            _enableCache = true;

        }
 public ExampleProvider(IHttpRequestSender requestSender = null)
 {
     _requestSender = requestSender ?? new HttpRequestSender();
 }
 public void InjectDependentInterface(IHttpRequestSender provisionService)
 {
     this.httpRequestSender = provisionService;
 }
Exemple #27
0
 public CallAnApi With(IHttpRequestSender sender)
 {
     this._sender = sender;
     return(this);
 }
 public SagePayPaymentRequestHandler()
 {
     _requestSender = new HttpRequestSender();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Sdk.Api.ApiRequestSender"/> class.
 /// </summary>
 /// <param name="configuration">Configuration.</param>
 /// <param name="credentials">Credentials to use in authorized requests and to refresh tokens</param>
 /// <param name="oauthService">OAuthService.</param>
 /// <param name="httpSender">HTTP instance to send API requests</param>
 internal ApiRequestSender(Configuration configuration, ICredentials credentials, IBynderClient bynderClient, IHttpRequestSender httpSender)
 {
     _configuration = configuration;
     _credentials   = credentials;
     _bynderClient  = bynderClient;
     _httpSender    = httpSender;
 }
 public ExampleProvider()
 {
     _requestSender = new HttpRequestSender();
 }
 public SagePayPaymentRequestHandler(IHttpRequestSender requestSender = null)
 {
     _requestSender = requestSender ?? new HttpRequestSender();
 }
		public RefundRegistrar(Configuration configuration, IHttpRequestSender requestSender) {
			this.configuration = configuration;
			this.requestSender = requestSender;
		}
Exemple #33
0
 public TransactionsService(IHttpRequestSender requestSender)
 {
     _requestSender = requestSender;
 }
Exemple #34
0
 public ValidatorConfirmationBlockService(IHttpRequestSender requestSender)
 {
     _requestSender = requestSender;
 }
 public AusPostProvider()
 {
     _requestSender = new HttpRequestSender();
 }
 /// <summary>
 /// Creates a new instance of the TransactionRegistrar
 /// </summary>
 public TransactionRegistrar(Configuration configuration, IUrlResolver urlResolver, IHttpRequestSender requestSender)
 {
     this.configuration = configuration;
     this.requestSender = requestSender;
     this.urlResolver = urlResolver;
 }
 public SisowPaymentRequestHandler()
 {
     _requestSender = new HttpRequestSender();
 }