Example #1
0
 public Api(IRequestor requestor)
 {
     Applicants = new Applicants(requestor);
     Documents  = new Documents(requestor);
     Checks     = new Checks(requestor);
     Reports    = new Reports(requestor);
 }
Example #2
0
 public StripeService(string apiKey, IMapper mapper, IRequestor requestor, IParameterBuilder parameterBuilder)
 {
     ApiKey = apiKey;
     Mapper = mapper;
     Requestor = requestor;
     ParameterBuilder = parameterBuilder;
 }
Example #3
0
 public StripeService(string apiKey, IMapper mapper, IRequestor requestor, IParameterBuilder parameterBuilder)
 {
     ApiKey           = apiKey;
     Mapper           = mapper;
     Requestor        = requestor;
     ParameterBuilder = parameterBuilder;
 }
Example #4
0
        static Requestor()
        {
#if WINDOWS_UWP
            Instance = new UniversalRequestor();
#else
            Instance = new DefaultRequestor();
#endif
        }
Example #5
0
        public Api(IRequestor requestor)
        {
            Applicants = new Applicants(requestor);

            Documents = new Documents(requestor);

            Checks = new Checks(requestor);

            Reports = new Reports(requestor);
        }
        public async Task <TResponse> Handle(IRequestor <TResponse> request, CancellationToken cancellationToken)
        {
            ValidationResult result = await this.validator.ValidateAsync(request.Item);;

            if (result.IsValid)
            {
                return(await this.handle(request, cancellationToken));
            }
            throw new ArgumentException(String.Join(",", result.Errors));
        }
Example #7
0
        public IResponse Request(string method, string path, RequestInfo info, IRequestor requestor)
        {
            var url = Url(path, info.QueryStrings);

            try {
                CurrentUri = new Uri(url);
            } catch (Exception ex) {
                Console.WriteLine("BAD URI.  method:{0} path:{1} url:{2}", method, path, url);
                LastException = ex;
                // We don't return null here because a custom IRequestor could support this URL, even if it's not a valid URI
            }

            IResponse response;

            try {
                response = requestor.GetResponse(method, url, info.PostData, MergeWithDefaultHeaders(info.Headers));
            } catch (Exception ex) {
                Console.WriteLine("Requestor ({0}) failed to respond for {1} {2} [{3}]", requestor.GetType(), method, path, url);
                Console.WriteLine("Requested info:");
                Console.WriteLine("\t{0} {1}", method, url);
                Console.WriteLine("\tPostData: " + string.Join(", ", info.PostData.Select(item => string.Format("{0} => {1}", item.Key, item.Value)).ToArray()));
                Console.WriteLine("\tHeaders:  " + string.Join(", ", info.Headers.Select(item => string.Format("{0} => {1}", item.Key, item.Value)).ToArray()));
                LastException = ex;
                return(null);
            }

            if (response == null)
            {
                return(null);
            }

            if (AutoRedirect)
            {
                while (IsRedirect(response))
                {
                    response = FollowRedirect(response);
                }
            }

            return(SetLastResponse(response));
        }
Example #8
0
 public Requestor(IRequestor implementation)
 {
     Implementation = implementation;
 }
Example #9
0
 public Reports(IRequestor requestor)
 {
     _requestor = requestor;
 }
Example #10
0
 public Reports(IRequestor requestor)
 {
     _requestor = requestor;
 }
Example #11
0
 public PingController(IRequestor requestor)
 {
     _requestor = requestor;
 }
Example #12
0
 public StudentsController(IRequestor requestor)
 {
     _requestor = requestor;
 }
Example #13
0
 protected BaseMoney(IRequestor requestor)
 {
     Requestor = requestor;
     requestor.ParentResourceName = parentResourceName;
 }
Example #14
0
		public StripeChargeService(string apiKey, IMapper mapper, IRequestor requestor, IParameterBuilder parameterBuilder)
			: base(apiKey, mapper, requestor, parameterBuilder)
		{
		}
Example #15
0
 public AppHangfireJobProcessor(IRequestor requestor,
                                IAppLogger <AppHangfireJobProcessor> logger)
 {
     _requestor = requestor;
     _logger    = logger;
 }
Example #16
0
 public Checks(IRequestor requestor)
 {
     _requestor = requestor;
 }
Example #17
0
 public Checks(IRequestor requestor)
 {
     _requestor = requestor;
 }
Example #18
0
 public Applicants(IRequestor requestor)
 {
     _requestor = requestor;
 }
Example #19
0
 public Documents(IRequestor requestor)
 {
     _requestor = requestor;
 }
Example #20
0
 public Broswer(IRequestor requestor)
 {
     _requestor = requestor;
 }
 protected abstract Task <TResponse> handle(IRequestor <TResponse> request, CancellationToken cancellationToken);
Example #22
0
 public Applicants(IRequestor requestor)
 {
     _requestor = requestor;
 }
Example #23
0
 public AppMessageConsumer(IRequestor requestor,
                           IAppLogger <AppMessageConsumer <TRequest> > logger)
 {
     _requestor = requestor;
     _logger    = logger;
 }
Example #24
0
 public Documents(IRequestor requestor)
 {
     _requestor = requestor;
 }
Example #25
0
 public PostRegistrationTask(IRequestor requestor)
 {
     _requestor = requestor;
 }
 protected override Task <U.User> handle(IRequestor <U.User> request, CancellationToken cancellationToken)
 {
     return(this.repository.CreateAsync(request.Item));
 }
 public StripeDisputeService(string apiKey, IMapper mapper, IRequestor requestor, IParameterBuilder parameterBuilder)
     : base(apiKey, mapper, requestor, parameterBuilder)
 {
 }
Example #28
0
 protected BaseTransaction(IRequestor requestor)
 {
     Requestor = requestor;
     requestor.ParentResourceName = parentResourceName;
 }