public Task <PaymentEntity> Handle(FindPaymentQuery request, CancellationToken cancellationToken) { return(Task.Run(() => { try { var res = string.IsNullOrEmpty(request.OrderId) ? _paymentRepository.FindPaymentByPaymentId(request.PaymentId) : _paymentRepository.FindPaymentByOrderId(request.OrderId); return res; } catch (Exception) { return null; } })); }