public USPSShipmentTracker(ILogger logger, SeeSharpShipUspsSettings uspsSettings)
        {
            _logger       = logger;
            _uspsSettings = uspsSettings;

            // ReSharper disable once CSharpWarnings::CS0618
            _trackService = string.IsNullOrWhiteSpace(uspsSettings.Url) ? new TrackService() : new TrackService(uspsSettings.Url, new PostRequest());
        }
コード例 #2
0
        /// <summary>
        ///     Install plugin
        /// </summary>
        public override void Install()
        {
            //settings
            var settings = new SeeSharpShipUspsSettings {
                Url      = "http://production.shippingapis.com/ShippingAPI.dll",
                Username = "******",
                Password = "******",
                AdditionalHandlingCharge          = 0,
                ZipPostalCodeFrom                 = "10022",
                BaseDomesticServicesSelected      = string.Empty,
                DomesticServicesSelected          = string.Empty,
                BaseInternationalServicesSelected = string.Empty,
                InternationalServicesSelected     = string.Empty,
                MinimumShippingCharge             = 0,
                InsuranceEnabled = false
            };

            _settingService.SaveSetting(settings);

            //locales
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.Url", "URL");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.Url.Hint", "Specify USPS URL.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.Username", "Username");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.Username.Hint", "Specify USPS username.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.Password", "Password");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.Password.Hint", "Specify USPS password.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.AdditionalHandlingCharge", "Additional handling charge");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.AdditionalHandlingCharge.Hint",
                                                 "Enter additional handling fee to charge your customers.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.ZipPostalCodeFrom", "Shipped from zip");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.ZipPostalCodeFrom.Hint", "Specify origin zip code.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.MinimumShippingCharge", "Minimum Shipping Charge");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.MinimumShippingCharge.Hint",
                                                 "Enter minimum shipping rate to charge your customers.");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.InsuranceEnabled", "Insurance Enabled");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.InsuranceEnabled.Hint",
                                                 "Enables the addition of insurance charges for both domestic and international shipments.");

            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.BaseDomesticServices", "Domestic Service Types");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.BaseDomesticServices.Hint",
                                                 "Select the service types you want to offer to customers.  Service types only affect how rate request is made.  ALL and ONLINE do not support insurance.");

            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.DomesticServices", "Domestic Services");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.DomesticServices.Hint",
                                                 "Select the services you want to offer to customers.");

            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.BaseInternationalServices", "International Service Types");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.BaseInternationalServices.Hint",
                                                 "Select the service types you want to offer to customers.  Service types only affect how rate request is made.");

            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.InternationalServices", "International Services");
            this.AddOrUpdatePluginLocaleResource("Plugins.Shipping.SeeSharpShipUsps.Fields.InternationalServices.Hint",
                                                 "Select the services you want to offer to customers.");

            base.Install();
        }
コード例 #3
0
        public USPSComputationMethod(IMeasureService measureService, ISettingService settingService, IShippingService shippingService,
                                     SeeSharpShipUspsSettings uspsSettings,
                                     IPriceCalculationService priceCalculationService, MeasureSettings measureSettings, ILogger logger)
        {
            _uspsVolumetricsService  = new USPSVolumetricsService(measureService, shippingService, measureSettings);
            _settingService          = settingService;
            _shippingService         = shippingService;
            _uspsSettings            = uspsSettings;
            _priceCalculationService = priceCalculationService;
            _loggerService           = logger;
            _uspsPackageSplitter     = new USPSPackageSplitterService(measureService, shippingService, measureSettings);

            // ReSharper disable once CSharpWarnings::CS0618
            _rateService = string.IsNullOrWhiteSpace(_uspsSettings.Url) ? new RateService() : new RateService(_uspsSettings.Url, new PostRequest());
        }