public void AddPosPaxTerminalOrderRequest(PaxTerminalTransactionRequest orderRequest)
        {
            var paxTerminalOrderRequestEntity = orderRequest.MapTo<PaxTerminalTransactionRequest, PaxPosOrderRequest>();

            _paxTerminalEntities.PaxPosOrderRequests.Add(paxTerminalOrderRequestEntity);

            _paxTerminalEntities.SaveChanges();
        }
Exemple #2
0
        private PaxTerminalTransactionRequest MapOrderToPaxTerminalRequest(OrderRequest request)
        {
            try
            {
                var paxTerminalTransactionResult = new PaxTerminalTransactionRequest
                {
                    AccountNumber = request.AccountNumber,
                    AddInfo1 = request.AddInfo1,
                    AddInfo2 = request.AddInfo2,
                    AltAccountNumber = request.AltAccountNumber,
                    CashierId = request.MerchantId.ToString(),
                    Country = request.CountryCode,
                    CustomerName = request.CustomerName,
                    Fee = request.Fee,
                    LicensePlate = request.LicensePlate,
                    OrderDate = request.OrderDate!= null? DateTime.Parse(request.OrderDate): DateTime.Now,
                    PaymentKeyWord = request.PaymentKeyWord,
                    PhoneNumber = request.PhoneNumber,
                    ProductId = request.ProductMainCode,
                    SenderName = request.SenderName,
                    PurchaseId = request.PurchaseId,
                    SerialNumber = request.SerialNumber,
                    TerminalId = request.TerminalId.ToString(),
                    TotalAmount = request.Amount.ToString(),
                    VendorId = request.VendorId
                };

                return paxTerminalTransactionResult;
            }
            catch (Exception exception)
            {
                return null;
            }
        }