Developer forum

Forum » Development » Subscription to "Ecom7CartCheckoutDoneOrderIsComplete" fails

Subscription to "Ecom7CartCheckoutDoneOrderIsComplete" fails


Reply

Hey,
 

I have run into a bit of a problem. Because of problems with displaying the order confirmation with DIBS payment, I would like to subscribe to "Ecom7CartCheckoutDoneOrderIsComplete" but it does not seem to work either. I getthe order as an argument, so it could be a way to circumvent the Cart v2 bug.
 

This just doesn't seem to work:

  [Dynamicweb.Extensibility.Subscribe ("Ecom7CartCheckoutDoneOrderIsComplete")]
  public class AfterDIBS: Dynamicweb.Extensibility.NotificationSubscriber
  (
    public override void OnNotify (string notification, object [] args)
    (
      HttpContext.Current.Response.Write ("notify");
    )
  )

Do I have to subscribe to eCom7 notifications in another way?
 

What to do here?


Replies

 
Reply
Hi there,

Have you tried the overload of Notify that accepts a NotificationArgs argument?

public override void OnNotify(string notification, NotificationArgs args)
{
  HttpContext.Current.Response.Write ("notify");
}

Hope this helps,

Imar
 
Reply
Hey again,

Yes, I have tried that - I should have placed both of them in the thread.

As far as I can see, their NotificationManager DO notify on 

Dynamicweb.Ecom7.Cart.

Notifications.CheckoutDoneOrderIsComplete, so it should work just like Dynamicweb.Notifications.Standard.Page.Loaded

What to do?
 
Reply
Hi Allan,

I just tried it myself, and the notification is triggered just fine, so conceptually it works.

When / where exactly do you expect this notification to be called? I tested it in a simple page without a payment gateway which means it triggers quite early, directly after entering the user details. With a payment provider, I think it only triggers when you visit step 6 because according to Reflector the order must be marked as complete:

public static void CheckoutDone(Order order)
{
  try
  {
    LogEvent(order, "Called CheckoutDone", new object[0]);
    if (order.Complete)
    {
      LogEvent(order, "Order is complete", new object[0]);
      Notifications.CheckoutDoneOrderIsCompleteArgs eventArgs = new Notifications.CheckoutDoneOrderIsCompleteArgs();
      eventArgs.Order = order;
      NotificationManager.Notify("Ecom7CartCheckoutDoneOrderIsComplete", eventArgs);
      int pageID = Base.ChkInteger(Base.Request("ID"));

Did you look in the event log files for eCom and see if this code gets called at all?

Cheers,

Imar
 
Nicolai Høeg Pedersen
Reply
I've seen issues where the assembly containing the notification subscriber is not loaded because it is not referenced by anything else.

In Default.aspx.cs/vb make sure it uses an Assembly that contains the notification subscriber or references the assembly containing the notification subscriber.

BR Nicolai

 

You must be logged in to post in the forum