/// <summary>
 /// Install plugin
 /// </summary>
 /// <returns>boolean status</returns>
 public static bool Install()
 {
     if (!installed)
     {
         bool isInstalled = ExpresslyProvider.build().Install(APIContext, ApiKey, ApiBaseUrl);
         installed = isInstalled;
         return(installed);
     }
     else
     {
         return(true);
     }
 }
        public static void confirmMigration(string campaignCustomerUuid, HttpResponse response)
        {
            if (merchantProvider == null)
            {
                throw new NotImplementedException("Not able to find IMerchantProvider implementation");
            }

            try
            {
                var customerMigrationData = ExpresslyProvider.build().FetchCustomerData(APIContext, campaignCustomerUuid);

                if (customerMigrationData.migration != null)
                {
                    if (merchantProvider.checkCustomerAlreadyExists(customerMigrationData.migration.customer.email))
                    {
                        merchantProvider.handleCustomerAlreadyExists(customerMigrationData.migration.customer.email, response);
                    }
                    else
                    {
                        string customerUserReference = merchantProvider.registerCustomer(customerMigrationData.migration.customer);

                        if (customerUserReference != null)
                        {
                            merchantProvider.sendPasswordResetEmail(customerUserReference);

                            if (customerMigrationData.cart != null)
                            {
                                if (merchantProvider.createCustomerCart(customerUserReference, customerMigrationData.cart))
                                {
                                    if (ExpresslyProvider.build().ConfirmMigration(APIContext, campaignCustomerUuid))
                                    {
                                        merchantProvider.loginAndRedirectCustomer(customerUserReference, response);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                merchantProvider.handleCustomerAlreadyExists(null, response);
            }
        }
 void IHttpModule.Init(HttpApplication context)
 {
     context.BeginRequest += new EventHandler(this.Сontext_BeginRequest);
     expresslyProvider = ExpresslyProvider.build();
 }