Step 10: Implementing the Connector Factory Class

For the system to create the connector class, you need to implement the connector factory class. For details about the connector factory class, see Connector Factory Class.

Implementing the Connector Factory Class

  1. In the Visual Studio project of the extension library, create a processor factory class that implements the PX.Commerce.Core.IConnectorFactory interface and derives from the PX.Commerce.Core.BaseConnectorFactory<WooCommerceConnector> abstract class, as shown in the following code.
    Tip: You can see this code on GitHub.
    using PX.Commerce.Core;
    using System;
    
    namespace WooCommerceTest
    {
        public class WooCommerceConnectorFactory : BaseConnectorFactory<WooCommerceConnector>, IConnectorFactory
        {
            public override string Description => WooCommerceConnector.NAME;
            public override bool Enabled => true;
    
            public override string Type => WooCommerceConnector.TYPE;
    
            public WooCommerceConnectorFactory(ProcessorFactory factory)
                : base(factory)
            {
            }
    
            public virtual Guid? GenerateExternID(BCExternNotification message)
            {
                throw new NotImplementedException();
            }
        }
    }
  2. Build the project.