Example #1
0
        private CommitResponse ReprintOrderForMetele(OrdersWebRequest webRequest)
        {
            try
            {
                var orderResponse = _paxTerminalService.RePrintOrder(webRequest.MerchantId, webRequest.TerminalId,
                    webRequest.OrderNumber, webRequest.SerialNumber);

                var orderResponseResult = orderResponse.UIMapTo<PaxTerminalResponse, CommitResponse>();

                return orderResponseResult;
            }

            catch (Exception exception)
            {
                if (exception is CustomException)
                {
                    var customException = exception as CustomException;

                    _logger.Debug(string.Format("Operation:ReprintOrder,Error Message:{3}, Parameters:MerchantId:{0},TerminalId:{1},SerialNumber:{2}", customException.MerchantId, customException.TerminalId, customException.SerialNumber, customException.Message));
                }
                return new CommitResponse
                {
                    ErrorMessage = exception.Message,
                    Status = 201,
                };
            }
        }
Example #2
0
        private CommitResponse ExecuteOrderForBlackstonePos(OrdersWebRequest webRequest)
        {
            try
            {
                var orderResponse = _blackstonePosService.ExecuteOrder(webRequest.MerchantId, webRequest.TerminalId,webRequest.OrderNumber, webRequest.SerialNumber, true);

                var orderResponseResult = orderResponse.UIMapTo<PaxTerminalResponse, CommitResponse>();

                return orderResponseResult;
            }

            catch (Exception exception)
            {
                //var errorMessage = string.Format("Errors trying to Execute the Order Number: {0}", webRequest.OrderNumber);

                if (exception is CustomException)
                {
                    var customException = exception as CustomException;

                    _logger.Debug(string.Format("Operation:ExecuteOrder,Error Message:{4}, Parameters:MerchantId:{0},TerminalId:{1},SerialNumber:{2}, OrderNumber: {3}", customException.MerchantId, customException.TerminalId, customException.SerialNumber, customException.OrderNumber, customException.Message));

                }
                return new CommitResponse
                {
                    ErrorMessage = exception.Message,
                    Status = 201,
                };
            }
        }