Class Ecommerce.Order.AfterOrderCapturedArgs
- Namespace
- Dynamicweb.Ecommerce.Notifications
- Assembly
- Dynamicweb.Ecommerce.dll
Provides information about order just when the Order is captured.
public class Ecommerce.Order.AfterOrderCapturedArgs : NotificationArgs
- Inheritance
-
Ecommerce.Order.AfterOrderCapturedArgs
- Inherited Members
Examples
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);
//}
}
}
}
Remarks
The passed NotificationArgs is Ecommerce.Order.AfterOrderCapturedArgs
Constructors
AfterOrderCapturedArgs(Order)
public AfterOrderCapturedArgs(Order order)
Parameters
order
Order
Properties
Order
Gets or sets the order.
public Order Order { get; set; }
Property Value
- Order
- Order. Setting this from a notification subscriber will have no effect.