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)); }
public void Create(Order entity) { _orderDal.Create(entity); }
public bool Create(Order entity) { _orderDal.Create(entity); return(true); }
public void Create(Order order) { _orderDal.Create(order); }