Esempio n. 1
0
        protected void RegisterButton_Click(object sender, System.EventArgs e)
        {
            CanadaPost provider = new CanadaPost();

            provider.MerchantCPCID = MerchantId.Text;
            provider.AccountActive = true;
            ShipGateway gateway = new ShipGateway();

            gateway.Name    = provider.Name;
            gateway.ClassId = Misc.GetClassId(typeof(CanadaPost));
            gateway.UpdateConfigData(provider.GetConfigData());
            gateway.Enabled = true;
            gateway.Save();
            Response.Redirect("Configure.aspx?ShipGatewayId=" + gateway.Id);
        }
        private void SaveShipGateWayProvider()
        {
            CanadaPost provider = (CanadaPost)_ShipGateway.GetProviderInstance();

            provider.UseDebugMode         = UseDebugMode.Checked;
            provider.UseTestMode          = UseTestMode.Checked;
            provider.EnablePackageBreakup = EnablePackaging.Checked;
            provider.MerchantCPCID        = MerchantId.Text;
            provider.LiveModeUrl          = LiveServerURL.Text;
            provider.TestModeUrl          = TestServerURL.Text;
            provider.TrackingUrl          = TrackingURL.Text;
            provider.MaxPackageWeight     = AlwaysConvert.ToDecimal(MaxWeight.Text, (decimal)provider.MaxPackageWeight);
            provider.MinPackageWeight     = AlwaysConvert.ToDecimal(MinWeight.Text, (decimal)provider.MinPackageWeight);
            _ShipGateway.UpdateConfigData(provider.GetConfigData());
            _ShipGateway.Save();
        }