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); } } }
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); } }
private void OnCreditCardPaymentCancellationFailed(CreditCardErrorThrown obj) { //flag as not cancelled? }