Skip to content

Commit db547dc

Browse files
committed
A tax provider should never be activated without any merchant interaction
1 parent f2a904a commit db547dc

5 files changed

Lines changed: 12 additions & 24 deletions

File tree

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Release Notes
1+
# Release Notes
22

33
## SmartStore.NET 2.5
44

@@ -56,6 +56,7 @@
5656
* #770 Resizing browser with product details page causes product image to disappear
5757
* GMC feed: Availability value "available for order" deprecated
5858
* Mobile: Shopping cart warnings weren't displayed to customers
59+
* Tax provider and payment method were automatically activated when there were no active provider\method
5960

6061

6162
## SmartStore.NET 2.2.2

src/Libraries/SmartStore.Services/Tax/TaxService.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@
88
using SmartStore.Core.Domain.Customers;
99
using SmartStore.Core.Domain.Orders;
1010
using SmartStore.Core.Domain.Tax;
11-
using SmartStore.Core.Infrastructure;
1211
using SmartStore.Core.Plugins;
1312
using SmartStore.Services.Common;
1413
using SmartStore.Services.Directory;
15-
using SmartStore.Services.Configuration;
1614

1715
namespace SmartStore.Services.Tax
1816
{
@@ -44,7 +42,6 @@ public TaxAddressKey(int customerId, bool productIsEsd)
4442
private readonly IPluginFinder _pluginFinder;
4543
private readonly IDictionary<TaxRateCacheKey, decimal> _cachedTaxRates;
4644
private readonly IDictionary<TaxAddressKey, Address> _cachedTaxAddresses;
47-
private readonly ISettingService _settingService;
4845
private readonly IProviderManager _providerManager;
4946
private readonly IGeoCountryLookup _geoCountryLookup;
5047

@@ -65,10 +62,8 @@ public TaxService(
6562
TaxSettings taxSettings,
6663
ShoppingCartSettings cartSettings,
6764
IPluginFinder pluginFinder,
68-
ISettingService settingService,
6965
IGeoCountryLookup geoCountryLookup,
70-
IProviderManager providerManager
71-
)
66+
IProviderManager providerManager)
7267
{
7368
this._addressService = addressService;
7469
this._workContext = workContext;
@@ -77,7 +72,6 @@ IProviderManager providerManager
7772
this._pluginFinder = pluginFinder;
7873
this._cachedTaxRates = new Dictionary<TaxRateCacheKey, decimal>();
7974
this._cachedTaxAddresses = new Dictionary<TaxAddressKey, Address>();
80-
this._settingService = settingService;
8175
this._providerManager = providerManager;
8276
this._geoCountryLookup = geoCountryLookup;
8377
}
@@ -274,9 +268,7 @@ public virtual Provider<ITaxProvider> LoadActiveTaxProvider()
274268
if (taxProvider == null)
275269
{
276270
taxProvider = LoadAllTaxProviders().FirstOrDefault();
277-
_taxSettings.ActiveTaxProviderSystemName = taxProvider.Metadata.SystemName;
278-
_settingService.SaveSetting(_taxSettings);
279-
}
271+
}
280272
return taxProvider;
281273
}
282274

src/Tests/SmartStore.Services.Tests/Orders/OrderProcessingServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public class OrderProcessingServiceTests : ServiceTest
159159
_httpRequestBase = MockRepository.GenerateMock<HttpRequestBase>();
160160
_geoCountryLookup = MockRepository.GenerateMock<IGeoCountryLookup>();
161161

162-
_taxService = new TaxService(_addressService, _workContext, _taxSettings, _shoppingCartSettings, pluginFinder, _settingService, _geoCountryLookup, this.ProviderManager);
162+
_taxService = new TaxService(_addressService, _workContext, _taxSettings, _shoppingCartSettings, pluginFinder, _geoCountryLookup, this.ProviderManager);
163163

164164
_rewardPointsSettings = new RewardPointsSettings();
165165

src/Tests/SmartStore.Services.Tests/Orders/OrderTotalCalculationServiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public class OrderTotalCalculationServiceTests : ServiceTest
133133
_httpRequestBase = MockRepository.GenerateMock<HttpRequestBase>();
134134
_geoCountryLookup = MockRepository.GenerateMock<IGeoCountryLookup>();
135135

136-
_taxService = new TaxService(_addressService, _workContext, _taxSettings, _shoppingCartSettings, pluginFinder, _settingService, _geoCountryLookup, this.ProviderManager);
136+
_taxService = new TaxService(_addressService, _workContext, _taxSettings, _shoppingCartSettings, pluginFinder, _geoCountryLookup, this.ProviderManager);
137137

138138
_rewardPointsSettings = new RewardPointsSettings();
139139

src/Tests/SmartStore.Services.Tests/Tax/TaxServiceTests.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Linq;
3+
using NUnit.Framework;
4+
using Rhino.Mocks;
45
using SmartStore.Core;
56
using SmartStore.Core.Domain.Catalog;
67
using SmartStore.Core.Domain.Common;
78
using SmartStore.Core.Domain.Customers;
9+
using SmartStore.Core.Domain.Orders;
810
using SmartStore.Core.Domain.Tax;
9-
using SmartStore.Core.Infrastructure;
11+
using SmartStore.Core.Events;
1012
using SmartStore.Core.Plugins;
1113
using SmartStore.Services.Common;
12-
using SmartStore.Core.Events;
14+
using SmartStore.Services.Directory;
1315
using SmartStore.Services.Tax;
1416
using SmartStore.Tests;
15-
using NUnit.Framework;
16-
using Rhino.Mocks;
17-
using SmartStore.Core.Domain.Orders;
18-
using SmartStore.Services.Configuration;
19-
using SmartStore.Services.Directory;
2017

2118
namespace SmartStore.Services.Tests.Tax
2219
{
@@ -29,7 +26,6 @@ public class TaxServiceTests : ServiceTest
2926
ShoppingCartSettings _cartSettings;
3027
IEventPublisher _eventPublisher;
3128
ITaxService _taxService;
32-
ISettingService _settingService;
3329
IGeoCountryLookup _geoCountryLookup;
3430

3531
[SetUp]
@@ -51,10 +47,9 @@ public class TaxServiceTests : ServiceTest
5147
_eventPublisher = MockRepository.GenerateMock<IEventPublisher>();
5248
_eventPublisher.Expect(x => x.Publish(Arg<object>.Is.Anything));
5349

54-
_settingService = MockRepository.GenerateMock<ISettingService>();
5550
_geoCountryLookup = MockRepository.GenerateMock<IGeoCountryLookup>();
5651

57-
_taxService = new TaxService(_addressService, _workContext, _taxSettings, _cartSettings, pluginFinder, _settingService, _geoCountryLookup, this.ProviderManager);
52+
_taxService = new TaxService(_addressService, _workContext, _taxSettings, _cartSettings, pluginFinder, _geoCountryLookup, this.ProviderManager);
5853
}
5954

6055
[Test]

0 commit comments

Comments
 (0)