Exemplo n.º 1
0
        public static async Task PayAndClose(IOrderServiceApi orderServiceApi, Guid orderId, decimal amount)
        {
            await Pay(orderServiceApi, orderId, amount);

            await Task.Delay(100);

            var response6 = await orderServiceApi.UpdateOrderStatusByOrderId("", orderId, (int)OrderStatus.Closed);

            Assert.AreEqual(null, response6.PostprocessingType);
        }
Exemplo n.º 2
0
        public async Task StartAsync()
        {
            var response1 = await _terminalApi.GetPagedActiveOrders(new OrderFilterDto()
            {
                Statuses = new [] { OrderStatus.New }, DateStart = DateTime.UtcNow.AddDays(-10), DateEnd = DateTime.UtcNow.AddMinutes(-15), Count = 10
            });

            IList <TerminalOrderDto> orders = response1.Value.Results;

            foreach (TerminalOrderDto orderDto in orders)
            {
                _orderServiceApi.ExecutionContext.OrderId = orderDto.OrderId;
                if (orderDto.PaymentStatus == PayStatus.NotPaidNotRefunded)
                {
                    await _orderServiceApi.UpdateOrderStatusByOrderId(null, orderDto.OrderId, (int)OrderStatus.Void);
                }
                else
                {
                    await _orderServiceApi.UpdateOrderStatusByOrderId(null, orderDto.OrderId, (int)OrderStatus.Closed);
                }
            }
        }