Exemplo n.º 1
0
            public async Task <bool> Handle(PayPaymentCommand request, CancellationToken cancellationToken)
            {
                Payment payment = await _paymentRepository.FindPayment(request.Id, cancellationToken);

                payment.PayPayment();
                await _paymentRepository.Save(payment, cancellationToken, request.MessageData);

                return(true);
            }
Exemplo n.º 2
0
            public async Task <CreatePaymentOutputModel> Handle(
                CreatePaymentCommand request,
                CancellationToken cancellationToken)
            {
                var payment = _paymentFactory
                              .WithTitle(request.Title)
                              .WithAmount(request.Amount)
                              .WithPaymentDue(request.PaymentDue)
                              .WithStudent(request.StudentId)
                              .Build();

                await _paymentRepository.Save(payment, cancellationToken, request.MessageData);

                return(new CreatePaymentOutputModel(payment.Id));
            }