HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/TDijk1/erp-apps.eu/wwwroot/App_Code/CMSModules/Ecommerce/GoPay/GoPayLoader.cs
using System;

using CMS.GlobalHelper;
using CMS.SettingsProvider;
using CMS.Ecommerce;
using CMS.Base;
using CMS.Core;

/// <summary>
/// GoPayLoader e-commerce loader class. Partial class ensures correct registration.
/// </summary>
/// 
[GoPayLoader]
public partial class CMSModuleLoader
{
    #region "Macro methods loader attribute"

    /// <summary>
    /// Module registration
    /// </summary>
    private class GoPayLoaderAttribute : CMSLoaderAttribute
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public GoPayLoaderAttribute()
        {
            // Require E-commerce module to load properly
            RequiredModules = new string[] { "CMS.Ecommerce" };
        }


        /// <summary>
        /// Initializes the module
        /// </summary>
        public override void Init()
        {
            // This line provides the ability to register the classes via web.config cms.extensibility section from App_Code
            ClassHelper.OnGetCustomClass += GetCustomClass;
        }


        /// <summary>
        /// Gets the custom class object based on the given class name. This handler is called when the assembly name is App_Code.
        /// </summary>
        private static void GetCustomClass(object sender, ClassEventArgs e)
        {
            if (e.Object == null)
            {
                // Provide your custom classes
                switch (e.ClassName.ToLower())
                {
                    // Define the class GoPayProvider inheriting the CMSPaymentGatewayProvider and you can customize the provider
                    case "gopayprovider":
                        e.Object = new GoPayPaymentProvider();
                        break;
                }
            }
        }
    }

    #endregion
}