public void Handle(CreditCardErrorThrown @event)
        {
            using (var context = _contextFactory.Invoke())
            {
                var payment = context.Find <OrderPaymentDetail>(@event.SourceId);
                if (payment != null)
                {
                    var orderReport = context.Find <OrderReportDetail>(payment.OrderId);

                    orderReport.Payment.IsCancelled = true;
                    orderReport.Payment.Error       = @event.Reason;

                    context.Save(orderReport);
                }
            }
        }
Ejemplo n.º 2
0
        public void Handle(CreditCardErrorThrown @event)
        {
            using (var context = _contextFactory.Invoke())
            {
                var payment = context.Set <OrderPaymentDetail>().Find(@event.SourceId);
                if (payment == null)
                {
                    throw new InvalidOperationException("Payment not found");
                }

                payment.IsCancelled = true;
                payment.Error       = @event.Reason;

                context.Save(payment);
            }
        }
Ejemplo n.º 3
0
 private void OnCreditCardPaymentCancellationFailed(CreditCardErrorThrown obj)
 {
     //flag as not cancelled?
 }