Example #1
0
 public void AddProcessPaymentEvent(/*ProcessedPayments processedPayments*/)
 {
     //from processedPayments assign: successfulPayments, FailedPayments and FraudCheckFlaggedOnHoldManualInterventionRequiredPayments for persistance:
     if (PassedInternalChecksReadyToTakePayments.Any())
     {
         SuccessfulPayments = this.PassedInternalChecksReadyToTakePayments.Select(x => new SuccessfulPayment()
         {
             Code = x.Code, Name = x.Name, Reference = x.Reference, Amount = x.Amount
         }).ToList();
     }
     if (InternalValidationFailedPayments.Any())
     {
         FailedPayments = this.InternalValidationFailedPayments.Select(x => new FailedPayment()
         {
             Code = x.Code, Name = x.Name, Reference = x.Reference, Amount = x.Amount
         }).ToList();
     }
     //Raise Domain Event ProcessedPayments: (for any interested other bounded contexts that might have the requirement to build read model projections from this event (surfaced through a domain event handler with an integration event publish).
     //RaiseDomainEvent(_processedPaymentEvent);
 }