public Task Cancel(MessageContext context, CancelPaymentsEvent inputEvent)
 {
     foreach (var id in inputEvent.Ids)
     {
         paymentsRepository.Cancel(id);
     }
     return(Task.CompletedTask);
 }
Beispiel #2
0
 public override Task <Empty> Cancel(CancelPaymentsRequest request, ServerCallContext context)
 {
     foreach (var id in request.Ids)
     {
         paymentsRepository.Cancel(id);
     }
     return(Task.FromResult(new Empty()));
 }
Beispiel #3
0
        public override Task <Empty> Cancel(CancelPaymentsRequest request, ServerCallContext context)
        {
            foreach (var id in request.Ids)
            {
                paymentsRepository.Cancel(id);
            }
            var cancelledPayments = request.Ids.Select(id => paymentsRepository.Get(id)).ToArray();

            if (cancelledPayments.Length > 0)
            {
                projectionChannel.Publish(context.RequestHeaders.GetFlowId(), new DataProjection <Models.Payment, string> {
                    Upsert = cancelledPayments
                });
            }
            return(Task.FromResult(new Empty()));
        }