Beispiel #1
0
        public async Task <Result> CompletePayment(OrderDto order)
        {
            var validation = Validator.Validate(order, new OrderValidation());

            if (!validation.IsSuccess)
            {
                return(validation);
            }

            if (order.PaymentType == PaymentType.Credit)
            {
                var payment = _paymentService.Pay(order);

                if (payment.Status != "success")
                {
                    return(new ErrorResult(payment.ErrorMessage));
                }
            }

            await _orderDal.Create(_mapper.Map <Order>(order));

            return(new SuccessResult(ResultMessages.PaymentSuccess));
        }
Beispiel #2
0
 public void Create(Order entity)
 {
     _orderDal.Create(entity);
 }
Beispiel #3
0
 public bool Create(Order entity)
 {
     _orderDal.Create(entity);
     return(true);
 }
 public void Create(Order order)
 {
     _orderDal.Create(order);
 }