private static void ProcessOrder(IOrderApi client, int i) { var order = new Order { Count = i, OrderDate = DateTime.Now, OrderId = Guid.NewGuid(), UnitPrice = 12.23m, UserName = "******" }; client.Add(order.OrderId, order); var orderFromDb = client.Get(order.OrderId); Debug.Assert(orderFromDb.Equals(order)); var removed = client.Remove(order.OrderId); Debug.Assert(removed); var removedOrder = client.Get(order.OrderId); removedOrder.UserName = ""; Debug.Assert(removedOrder.Equals(new Order {UserName = ""})); Log.WriteLine("Order {0}", i); }
// GET: B2B public B2BController(IAuthenticationService authenticationService, ICustomerApi customerRepository, IB2BApi b2bRepository, IOrderApi orderRepository) { _authenticationService = authenticationService; _customerRepository = customerRepository; _b2bRepository = b2bRepository; _orderRepository = orderRepository; }
public TestOrderApiController() { _dataProviderMock = new Mock <IDataProvider>(); _kafkaSettings = new Mock <IOptions <KafkaSettings> >(); _deadlineManager = new Mock <IDeadlineManager>(); _orderManager = new Mock <IOrderManager>(); _logProvider = new Mock <ILogProvider>(); _metricsProvider = new Mock <IMetricsProvider>(); //_orderManager = new OrderManager(_dataProviderMock.Object, _pubSubProvider.Object, _kafkaSettings.Object); _order = new Order() { EventID = "TestEventID", OrderId = "TestOrderId", OrderSubmitTime = DateTime.Now, Username = Guid.NewGuid().ToString(), ValueA = "TestValueA", ValueB = "TestValueB" }; _submitOrderDto = new SubmitOrderDto() { EventID = "TestEventID", Username = Guid.NewGuid().ToString(), ValueA = "TestValueA", ValueB = "TestValueB" }; _orderApi = new OrderApiController(_deadlineManager.Object, _orderManager.Object, _logProvider.Object, _metricsProvider.Object, _kafkaSettings.Object); Mapper.Initialize(cfg => { cfg.CreateMap <SubmitOrderDto, Order>(); cfg.CreateMap <CommitOrderDto, Order>(); }); }
public ApiFactory(IBasketApi basketApi, IOrderApi orderApi, IUsersApi usersApi, IProductApi productApi) { _basketApi = basketApi; _orderApi = orderApi; _usersApi = usersApi; _productApi = productApi; }
private static void ProcessOrder(IOrderApi client, int i) { var order = new Order { Count = i, OrderDate = DateTime.Now, OrderId = Guid.NewGuid(), UnitPrice = 12.23m, UserName = "******" }; client.Add(order.OrderId, order); var orderFromDb = client.Get(order.OrderId); Debug.Assert(orderFromDb.Equals(order)); var removed = client.Remove(order.OrderId); Debug.Assert(removed); var removedOrder = client.Get(order.OrderId); removedOrder.UserName = ""; Debug.Assert(removedOrder.Equals(new Order { UserName = "" })); Log.WriteLine("Order {0}", i); }
public CheckOutModel(ICatalogApi catalogApi, IBasketApi basketApi, IUserApi userApi, IOrderApi orderApi) { _catalogApi = catalogApi ?? throw new ArgumentNullException(nameof(catalogApi)); _basketApi = basketApi ?? throw new ArgumentNullException(nameof(basketApi)); _userApi = userApi ?? throw new ArgumentNullException(nameof(_userApi)); _orderApi = orderApi ?? throw new ArgumentNullException(nameof(_orderApi)); }
public BasketController(IBasketApi basketApi, IShippingApi shippingApi, ICustomerApi customerRepository, IOrderApi orderRepository) { _basketApi = basketApi; _shippingApi = shippingApi; _customerRepository = customerRepository; _orderRepository = orderRepository; }
public OrderController(IOrderApi orderApi) { if (orderApi == null) { throw new ArgumentNullException(); } _orderApi = orderApi; }
public SyncServerService(IProductApi productApi, IThemeApi themeApi, IShippingApi shippingApi, IPaymentApi paymentApi, IOrderApi orderApi) { _themeApi = themeApi; _productApi = productApi; _shippingApi = shippingApi; _paymentApi = paymentApi; _orderApi = orderApi; }
public OrderApi(IConfiguration config, HttpClient httpClient) { var apiHostAndPort = config.GetSection("ApiServiceLocations"). GetValue <string>("OrdersApiLocation"); httpClient.BaseAddress = new Uri($"http://{apiHostAndPort}/api"); _restClient = RestService.For <IOrderApi>(httpClient); }
public AccountController(IAuthenticationService authenticationService, ICustomerApi customerRepository, IOrderApi orderRepository, IConfigApi configApi, IBasketApi basketApi, ISocialLoginService socialService) { _authenticationService = authenticationService; _customerRepository = customerRepository; _orderRepository = orderRepository; _configApi = configApi; _basketApi = basketApi; _socialService = socialService; }
public OrdersViewModel( IPreferencesService preferencesService, ILoggingService loggingService, IRefitService refitService, ITaskHelperFactory taskHelperFactory) { this.orderApi = refitService.InitRefitInstance <IOrderApi>(isAutenticated: true); this.preferencesService = preferencesService; this.loggingService = loggingService; this.taskHelperFactory = taskHelperFactory; }
// private readonly IPaymentMethod _paymentMethod; public CheckoutController(ICustomerApi customerApi, IConfigApi configApi, IPaymentApi paymentApi, ICheckoutApi checkoutApi, IOrderApi orderApi, IShippingApi shippingApi, IAuthenticationService authenticationService, ICustomerApi customerRepository, IB2BApi b2bRepository) { _customerApi = customerApi; _configApi = configApi; _paymentApi = paymentApi; _checkoutApi = checkoutApi; _orderApi = orderApi; _shippingApi = shippingApi; _authenticationService = authenticationService; _customerRepository = customerRepository; _b2bRepository = b2bRepository; }
public ERPRestGateway(ERPRestSettings erpRestSettings, ILogger <ERPRestGateway> logger, IBackupRepository repository) { _restClient = new RestClient(); _restClient.ClearHandlers(); _restClient.AddHandler("application/json", new NewtonsoftJsonSerializer()); _restClient.Timeout = erpRestSettings.Timeout; _erpRestSettings = erpRestSettings; _erpApi = new ErpApi.ErpApi(erpRestSettings.IntegrationPlatformBaseUrl, erpRestSettings.UserName, erpRestSettings.PassWord); _atgOrderApi = new AtgApi.OrderApi(erpRestSettings); ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, errors) => true; _logger = logger; _repository = repository; _baseUrl = erpRestSettings.AtgBaseUrl; }
public OrderViewModel( IRefitService refitService, IPreferencesService preferencesService, ITaskHelperFactory taskHelperFactory, ILoggingService loggingService, IDialogService dialogService) { this.orderApi = refitService.InitRefitInstance <IOrderApi>(isAutenticated: true); this.preferencesService = preferencesService; this.taskHelperFactory = taskHelperFactory; this.loggingService = loggingService; this.dialogService = dialogService; RefreshCommand = new AsyncCommand(() => RefreshCommandAsync()); OpenChatCommand = new AsyncCommand <Order>((order) => OpenChatCommandAsync(order)); CancelOrderCommand = new AsyncCommand <Order>((order) => CancelOrderCommandExecute(order)); AcceptOrderCommand = new AsyncCommand <Order>((order) => AcceptOrderCommandExecute(order)); }
public CartViewModel( IPreferencesService preferencesService, ISessionService sessionService, ILoggingService loggingService, IDialogService dialogService, IRefitService refitService, ITaskHelperFactory taskHelperFactory) { this.preferencesService = preferencesService; this.sessionService = sessionService; this.loggingService = loggingService; this.taskHelperFactory = taskHelperFactory; this.orderApi = refitService.InitRefitInstance <IOrderApi>(isAutenticated: true); MakeOrderCommand = new AsyncCommand(async() => await MakeOrderCommandAsync()); RemoveItemCommand = new AsyncCommand <OrderProduct>(RemoveItemCommandExecute); }
public OrderModel(IOrderApi orderAPi) { _orderAPi = orderAPi; }
public MasterCardController(ICheckoutApi checkoutApi, IOrderApi orderApi) { _checkoutApi = checkoutApi; _orderApi = orderApi; }
public static string GetSomething() { IOrderApi api = RestService.For <IOrderApi>("http://test.no"); return(api.List(new CancellationToken()).GetAwaiter().GetResult()); }
public OrderModel(IOrderApi orderApi) { _orderApi = orderApi ?? throw new ArgumentNullException(nameof(orderApi)); }
public PaypalController(ICheckoutApi checkoutApi, IOrderApi orderApi) { _checkoutApi = checkoutApi; _orderApi = orderApi; }
public WorldpayController(HttpContextBase httpContext, ICheckoutApi checkoutApi, IOrderApi orderApi) { _httpContext = httpContext; _checkoutApi = checkoutApi; _orderApi = orderApi; }
public BrowseSuppliersController(ISupplierApi supplierApi, IProductApi productApi, IOrderApi orderApi) { _supplierApi = supplierApi; _productApi = productApi; _orderApi = orderApi; }
public HttpTransferOrder(IOrderApi orderApi, ILoggerFactory logger) { this._orderApi = orderApi; this._logger = logger.CreateLogger("HttpTransferOrder"); _logger.LogInformation($"{DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")} - HttpTransferOrder em execução."); }
public KlarnaController(HttpContextBase httpContext, ICheckoutApi checkoutApi, IOrderApi orderApi) { _checkoutApi = checkoutApi; _orderApi = orderApi; }
public CodController(IOrderApi orderApi) { _orderApi = orderApi; }
public RetailerCommonController(ISupplierApi supplierApi, IProductApi productApi, IOrderApi orderApi) { _supplierApi = supplierApi; _productApi = productApi; _orderApi = orderApi; }
public OrderService(IOrderApi orderApi) { _orderApi = orderApi; }
public AccountCreditController(IOrderApi orderApi) { _orderApi = orderApi; }
public OrderModel(IOrderApi orderApi) { _orderApi = orderApi; }
public OrderModel(IApiFactory factory) { _orderApi = factory.OrderApi ?? throw new ArgumentNullException(nameof(_orderApi)); }