示例#1
0
        public IActionResult Post([FromBody] CheckoutOrderView value)
        {
            SaleView saleView = null;

            try
            {
                saleView = checkoutApplicationService.OrderSale(value);
            }
            catch (System.Exception ex)
            {
                return(BadRequest(ex.Message));
            }

            return(Json(saleView));
        }
示例#2
0
        public static CheckoutOrder MapToDomain(CheckoutOrderView order)
        {
            CheckoutOrder checkout = null;

            if (order != null)
            {
                checkout = new CheckoutOrder()
                {
                    CreditCardFlag   = order.CreditCardFlag,
                    CreditCardNumber = order.CreditCardNumber,
                    Email            = order.Email,
                    ExpirationMonth  = order.ExpirationMonth,
                    ExpirationYear   = order.ExpirationYear,
                    Name             = order.Name,
                    NameOnCreditCard = order.NameOnCreditCard,
                    SecurityCode     = order.SecurityCode,
                    TransactionValue = order.TransactionValue,
                    MerchantId       = order.MerchantId
                };
            }

            return(checkout);
        }