コード例 #1
0
ファイル: Payment.cs プロジェクト: njaka/Payment
        public Payment Paid()
        {
            this.Status = PaymentStatus.Succeed;

            RegisterEvent(
                OrderPaymentPaid
                .CreateNewOrderPaymentPaid(
                    this.PaymentId.Value,
                    this.Amount.Amount,
                    this.Amount.Currency.ToString(),
                    this.Status.ToString(),
                    this.BeneficiaryAlias
                    )
                );
            return(this);
        }
コード例 #2
0
ファイル: PaymentProjection.cs プロジェクト: njaka/Payment
 private void UpdateStatus(OrderPaymentPaid OrderPayment)
 {
     _events[OrderPayment.AggregateId].Paid();
 }
コード例 #3
0
 public async Task Handle(OrderPaymentPaid notification, CancellationToken cancellationToken)
 {
     // Talk with NJaka about stream name
     await _eventSourcing.RaiseEventAsync(notification, $"{STREAMNAME}{notification.BeneficiaryAlias}");
 }
コード例 #4
0
 private void AddBalance(OrderPaymentPaid orderPayment, Balance balance)
 {
     Balance = balance.Add(Money.FromDecimal(orderPayment.Amount, orderPayment.Currency, new CurrencyLookup())).Value;
 }