Click or drag to resize

EcommerceOrderAfterOrderCapturedArgs Class

Provides information about order just when the Order is captured.
Inheritance Hierarchy
SystemObject
  Dynamicweb.Extensibility.NotificationsNotificationArgs
    Dynamicweb.Ecommerce.NotificationsEcommerceOrderAfterOrderCapturedArgs

Namespace:  Dynamicweb.Ecommerce.Notifications
Assembly:  Dynamicweb.Ecommerce (in Dynamicweb.Ecommerce.dll) Version: 1.10.0
Syntax
public class AfterOrderCapturedArgs : NotificationArgs

The EcommerceOrderAfterOrderCapturedArgs type exposes the following members.

Constructors
  NameDescription
Public methodEcommerceOrderAfterOrderCapturedArgs
Initializes a new instance of the EcommerceOrderAfterOrderCapturedArgs class
Top
Properties
  NameDescription
Public propertyOrder
Gets or sets the order.
Top
Remarks
The passed NotificationArgs is EcommerceOrderAfterOrderCapturedArgs
Examples
C#
using Dynamicweb.Ecommerce;
using Dynamicweb.Extensibility.Notifications;

namespace Dynamicweb.Examples.CSharp.Notifications.eCommerce.Order
{
    /// <summary>
    /// Observer for order after capture notification used for commiting avalara taxes.
    /// </summary>
    [Subscribe(Ecommerce.Notifications.Ecommerce.Order.AfterOrderCaptured)]
    public class EcomOrderTaxCommitAfterCaptureObserver : NotificationSubscriber
    {
        public override void OnNotify(string notification, NotificationArgs args)
        {
            //Getting arguments with captured order
            Ecommerce.Notifications.Ecommerce.Order.AfterOrderCapturedArgs afterCaptureArgs = args as Ecommerce.Notifications.Ecommerce.Order.AfterOrderCapturedArgs;

            //for each taxsettings applicable to order, set on Settings->Ecommerce->Product catalog->Taxes
            //foreach (var taxSetting in TaxSetting.GetActiveTaxSettings(afterCaptureArgs.Order))
            //{
                //var taxProvider = taxSetting.TaxProvider;
                //enable commit for avalara tax provider
                //if (taxProvider is AvalaraTaxProvider)
                //{
                    //AvalaraTaxProvider providerInstance = (AvalaraTaxProvider)taxProvider;
                    //providerInstance.EnableCommit = true;
                //}

                //commit taxes and log event

                //taxProvider.CommitTaxes(afterCaptureArgs.Order);
                //var name = taxProvider.GetType().FullName;
                //var dirPath = string.Format("/eCom/TaxProvider/{0}", name);
                //LogToFile.Log("taxes commited after capture", dirPath, LogToFile.LogType.ManyEntriesPerFile);
            //}
        }
    }
}
See Also