33using SmartStore . AmazonPay . Models ;
44using SmartStore . AmazonPay . Services ;
55using SmartStore . AmazonPay . Settings ;
6- using SmartStore . Services ;
76using SmartStore . Services . Payments ;
8- using SmartStore . Services . Stores ;
97using SmartStore . Web . Framework . Controllers ;
108using SmartStore . Web . Framework . Security ;
119using SmartStore . Web . Framework . Settings ;
@@ -15,17 +13,10 @@ namespace SmartStore.AmazonPay.Controllers
1513 public class AmazonPayController : PaymentControllerBase
1614 {
1715 private readonly IAmazonPayService _apiService ;
18- private readonly ICommonServices _services ;
19- private readonly IStoreService _storeService ;
2016
21- public AmazonPayController (
22- IAmazonPayService apiService ,
23- ICommonServices services ,
24- IStoreService storeService )
17+ public AmazonPayController ( IAmazonPayService apiService )
2518 {
2619 _apiService = apiService ;
27- _services = services ;
28- _storeService = storeService ;
2920 }
3021
3122 [ NonAction ]
@@ -46,15 +37,15 @@ public override ProcessPaymentRequest GetPaymentInfo(FormCollection form)
4637 public ActionResult Configure ( )
4738 {
4839 var model = new ConfigurationModel ( ) ;
49- int storeScope = this . GetActiveStoreScopeConfiguration ( _storeService , _services . WorkContext ) ;
50- var settings = _services . Settings . LoadSetting < AmazonPaySettings > ( storeScope ) ;
40+ int storeScope = this . GetActiveStoreScopeConfiguration ( Services . StoreService , Services . WorkContext ) ;
41+ var settings = Services . Settings . LoadSetting < AmazonPaySettings > ( storeScope ) ;
5142
5243 model . Copy ( settings , true ) ;
5344
5445 _apiService . SetupConfiguration ( model ) ;
5546
5647 var storeDependingSettingHelper = new StoreDependingSettingHelper ( ViewData ) ;
57- storeDependingSettingHelper . GetOverrideKeys ( settings , model , storeScope , _services . Settings ) ;
48+ storeDependingSettingHelper . GetOverrideKeys ( settings , model , storeScope , Services . Settings ) ;
5849
5950 return View ( model ) ;
6051 }
@@ -68,26 +59,33 @@ public ActionResult Configure(ConfigurationModel model, FormCollection form)
6859 ModelState . Clear ( ) ;
6960
7061 var storeDependingSettingHelper = new StoreDependingSettingHelper ( ViewData ) ;
71- int storeScope = this . GetActiveStoreScopeConfiguration ( _storeService , _services . WorkContext ) ;
72- var settings = _services . Settings . LoadSetting < AmazonPaySettings > ( storeScope ) ;
62+ int storeScope = this . GetActiveStoreScopeConfiguration ( Services . StoreService , Services . WorkContext ) ;
63+ var settings = Services . Settings . LoadSetting < AmazonPaySettings > ( storeScope ) ;
7364
7465 model . Copy ( settings , false ) ;
7566
76- using ( _services . Settings . BeginScope ( ) )
67+ using ( Services . Settings . BeginScope ( ) )
7768 {
78- storeDependingSettingHelper . UpdateSettings ( settings , form , storeScope , _services . Settings ) ;
69+ storeDependingSettingHelper . UpdateSettings ( settings , form , storeScope , Services . Settings ) ;
7970
80- _services . Settings . SaveSetting ( settings , x => x . DataFetching , 0 , false ) ;
81- _services . Settings . SaveSetting ( settings , x => x . PollingMaxOrderCreationDays , 0 , false ) ;
71+ Services . Settings . SaveSetting ( settings , x => x . DataFetching , 0 , false ) ;
72+ Services . Settings . SaveSetting ( settings , x => x . PollingMaxOrderCreationDays , 0 , false ) ;
8273 }
8374
8475 _apiService . DataPollingTaskUpdate ( settings . DataFetching == AmazonPayDataFetchingType . Polling , model . PollingTaskMinutes * 60 ) ;
8576
86- NotifySuccess ( _services . Localization . GetResource ( "Plugins.Payments.AmazonPay.ConfigSaveNote" ) ) ;
77+ NotifySuccess ( Services . Localization . GetResource ( "Plugins.Payments.AmazonPay.ConfigSaveNote" ) ) ;
8778
8879 return Configure ( ) ;
8980 }
9081
82+ [ ChildActionOnly ]
83+ public ActionResult AuthenticationPublicInfo ( )
84+ {
85+ var model = _apiService . CreateViewModel ( AmazonPayRequestType . Authentication , TempData ) ;
86+ return View ( model ) ;
87+ }
88+
9189 [ HttpPost ]
9290 [ ValidateInput ( false ) ]
9391 [ RequireHttpsByConfigAttribute ( SslRequirement . Yes ) ]
0 commit comments