Exemplo n.º 1
0
        public IActionResult Post([FromBody] OrderInputModel inputModel)
        {
            var paymentMethod = _paymentMethodService.GetById(inputModel.PaymentMethodId);
            var payment       = _mapper.Map <CreditCard>(inputModel.CreditCard) ?? BankSlip.Create() as Payment;
            var address       = _addressService.GetById(inputModel.AddressId);

            _orderService.ProcessOrder(User.Identity.Name, paymentMethod, payment, address, inputModel.CouponCode);

            return(Ok());
        }