コード例 #1
0
        public PayInternalClient(PayInternalServiceClientSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            if (string.IsNullOrEmpty(settings.ServiceUrl))
            {
                throw new Exception("Service URL required");
            }

            _httpClient = new HttpClient
            {
                BaseAddress           = new Uri(settings.ServiceUrl),
                DefaultRequestHeaders =
                {
                    {
                        "User-Agent",
                        $"{PlatformServices.Default.Application.ApplicationName}/{PlatformServices.Default.Application.ApplicationVersion}"
                    }
                }
            };

            _payInternalApi     = RestService.For <IPayInternalApi>(_httpClient);
            _merchantsApi       = RestService.For <IMerchantsApi>(_httpClient);
            _ordersApi          = RestService.For <IOrdersApi>(_httpClient);
            _paymentRequestsApi = RestService.For <IPaymentRequestsApi>(_httpClient);
            _assetsApi          = RestService.For <IAssetsApi>(_httpClient);
            _markupsApi         = RestService.For <IMarkupsApi>(_httpClient);
            _runner             = new ApiRunner();
        }
 public AccuracyService(
     IAssetsApi assetsApi,
     ILog log)
 {
     _assetsApi = assetsApi;
     _log       = log;
 }
コード例 #3
0
ファイル: AssetsManager.cs プロジェクト: alpo-8/MT
 public AssetsManager(IAssetsApi assets,
                      AssetsCache assetsCache,
                      IConvertService convertService)
 {
     _assets         = assets;
     _assetsCache    = assetsCache;
     _convertService = convertService;
 }