I have this notification for at CartV2
[Subscribe(Dynamicweb.Ecom7.Cart.Notifications.CheckoutDoneOrderIsComplete)] public class EcomOrderStateChangedObserver : Dynamicweb.Extensibility.NotificationSubscriber { public override void OnNotify(string notification, object[] args) { try { System.IO.File.WriteAllText(@"E:\path\to\file.txt", "order completed"); } catch(Exception e) { System.IO.File.WriteAllText(@"E:\path\to\file.txt", "order completed" + e.Message + e.StackTrace); } } }
Keep in mind that I have written a custom checkout handler to a 3 party payment service. Maybe it is this that is causing the trouble? My redirect method looks like this:
public override string Redirect(Dynamicweb.eCommerce.Orders.Order order) { string result = null; string orderStatus = HttpContext.Current.Request.QueryString["order"]; if (orderStatus == "complete") { order.TransactionStatus = "completed"; base.SetOrderComplete(order); base.CheckoutDone(order); order.Save(); LogEvent(order, "complete"); base.RedirectToCart(order); } else { LogError(order, "transaktionen fejlede"); order.TransactionStatus = "failed"; order.Save(); base.CheckoutDone(order); result = PrintErrorTemplate(order); } return result; }
I do not call any, or init, any observer collections or so, as I think that it is DWs job. But maybe I am forgetting something? I have tried the same with OrderIsPassedToCheckoutHandler and the same code, and this is not called either.