Scippy
  •  Scippy
  • 100% (Exalted)
  • Advanced Member Topic Starter
2020-11-27T10:24:31Z
Upgrading to latest HCC 3.5.0 from HCC 3.4.0 on DNN9 I receive an exception on checkout page, see below exception details:

Errore: Checkout non è attualmente disponibile. DotNetNuke.Services.Exceptions.ModuleLoadException: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.Web.HttpException: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Hotcakes.Modules.Core.Controllers.CheckoutController.LoadCheckoutModel() at Hotcakes.Modules.Core.Controllers.CheckoutController.Index() at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerAsyncWrapper.<>c__DisplayClassa.<EndProcessRequest>b__9() at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3() at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap(Action action) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerAsyncWrapper.EndProcessRequest(IAsyncResult result) at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) --- End of inner exception stack trace --- at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) at System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) at Hotcakes.Commerce.Dnn.Mvc.MvcRenderingEngine.Render(String controllerName, String actionName, String viewName, Object routeValues) at Hotcakes.Modules.Checkout.CheckoutView.RenderView() at Hotcakes.Commerce.Dnn.Web.HotcakesModuleBase.OnLoad(EventArgs e) --- End of inner exception stack trace ---


Any idea about?
Will Strohl
2020-12-01T06:10:43Z
You probably still need to merge missing updates from the newest viewset.

https://hotcakescommerce...-When-Upgrading-Hotcakes 

https://hotcakescommerce...iew-doesn-t-work-anymore 


Will Strohl, Upendo Ventures
Hotcakes Cloud  | Get Support  | Code Support 
Official Cloud & Support provider for Hotcakes
Scippy
  •  Scippy
  • 100% (Exalted)
  • Advanced Member Topic Starter
2020-12-02T14:25:38Z
I also thought that was the problem, but I tried to replace the content of the used /views/checkout folder with the contents of the same folder in the HotcakesViews.zip package contained in the new HCC 3.5 module and it keeps giving the same error.
The error is still there also if I try to leave empty the /views/checkout folder.
I notice to you that I'm using the latest DNN 9.8.0
Will Strohl
2020-12-02T18:11:51Z
Please take a look in your hcc_StoreSettings folder. Do you have any records for the specific store ID that begin with "AES"?
Will Strohl, Upendo Ventures
Hotcakes Cloud  | Get Support  | Code Support 
Official Cloud & Support provider for Hotcakes
Scippy
  •  Scippy
  • 100% (Exalted)
  • Advanced Member Topic Starter
2020-12-02T19:35:18Z
Do you mean hcc_StoreSettings table?
I've checked but nothing start with "AES"
Will Strohl
2020-12-02T20:41:00Z
Originally Posted by: Scippy 

Do you mean hcc_StoreSettings table?
I've checked but nothing start with "AES"


Ah, yes. I meant table, not folder. ๐Ÿ™‚

For each store, there should be two records matching this query, beginning with Hotcakes Commerce 3.5.0.

SELECT * FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] LIKE N'AES%' ORDER BY [StoreId], [SettingName];

Please try the following SQL script, then clear the site cache, and let me know if this resolves the issue. You'll want to run this for each store.


SELECT * FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] LIKE N'AES%' ORDER BY [SettingName];

DECLARE @StoreId INT, @AesValue NVARCHAR(MAX);
SET @StoreId = 1;  -- default for a one-store instance
SET @AesValue = CAST(LEFT((CONVERT(decimal(30,0),(((RAND()*999999999999)/0.00012345671)*999999999))),16) AS nvarchar(16));

IF EXISTS (SELECT 1 FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] = N'AESKey' AND [StoreId] = @StoreId)
BEGIN
	UPDATE [dbo].[hcc_StoreSettings] SET [SettingValue] = @AesValue WHERE [SettingName] = N'AESKey' AND [StoreId] = @StoreId;
END
ELSE
BEGIN 
	INSERT INTO [dbo].[hcc_StoreSettings] ([StoreId], [SettingName], [SettingValue]) 
	VALUES (@StoreId, N'AESKey', @AesValue);
END

IF EXISTS (SELECT 1 FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] = N'AESInitVector' AND [StoreId] = @StoreId)
BEGIN
	UPDATE [dbo].[hcc_StoreSettings] SET [SettingValue] = @AesValue WHERE [SettingName] = N'AESInitVector' AND [StoreId] = @StoreId;
END
ELSE
BEGIN 
	INSERT INTO [dbo].[hcc_StoreSettings] ([StoreId], [SettingName], [SettingValue]) 
	VALUES (@StoreId, N'AESInitVector', @AesValue);
END

SELECT * FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] LIKE N'AES%' ORDER BY [SettingName];

Will Strohl, Upendo Ventures
Hotcakes Cloud  | Get Support  | Code Support 
Official Cloud & Support provider for Hotcakes
Scippy
  •  Scippy
  • 100% (Exalted)
  • Advanced Member Topic Starter
2020-12-03T11:28:19Z
Yes! Now work fine! Thanks!!!
Is it possible to know more about this two new hcc_StoreSettings records AESInitVector and AESKey?
Will Strohl
2020-12-03T17:54:03Z
Originally Posted by: Scippy 

Yes! Now work fine! Thanks!!!
Is it possible to know more about this two new hcc_StoreSettings records AESInitVector and AESKey?



Those values are used to help secure the communications between the web browser and the server on the checkout page. I'm afraid that we won't say much more publicly about security-related things like this. ๐Ÿ™‚
Will Strohl, Upendo Ventures
Hotcakes Cloud  | Get Support  | Code Support 
Official Cloud & Support provider for Hotcakes
Scippy
  •  Scippy
  • 100% (Exalted)
  • Advanced Member Topic Starter
2021-02-25T10:04:54Z
Hi Will,
I've five eshop in the same DNN 9.8.1 installation, all work fine but suddenly this error reappeared and now on all five eshops I have this error on the checkout page!


Errore: Checkout non è attualmente disponibile. DotNetNuke.Services.Exceptions.ModuleLoadException: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.Web.HttpException: Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Hotcakes.Modules.Core.Controllers.CheckoutController.LoadCurrentCustomer(CheckoutViewModel model) at Hotcakes.Modules.Core.Controllers.CheckoutController.LoadCheckoutModel() at Hotcakes.Modules.Core.Controllers.CheckoutController.Index() at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.<InvokeActionMethodFilterAsynchronouslyRecursive>b__41() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End() at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerAsyncWrapper.<>c__DisplayClassa.<EndProcessRequest>b__9() at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.<>c__DisplayClass4.<Wrap>b__3() at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap[TResult](Func`1 func) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerWrapper.Wrap(Action action) at System.Web.Mvc.HttpHandlerUtil.ServerExecuteHttpHandlerAsyncWrapper.EndProcessRequest(IAsyncResult result) at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) --- End of inner exception stack trace --- at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) at System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) at System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) at System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) at Hotcakes.Commerce.Dnn.Mvc.MvcRenderingEngine.Render(String controllerName, String actionName, String viewName, Object routeValues) at Hotcakes.Modules.Checkout.CheckoutView.RenderView() at Hotcakes.Commerce.Dnn.Web.HotcakesModuleBase.OnLoad(EventArgs e) --- End of inner exception stack trace ---

I've checked AESInitVector and AESKey and all are setted for each shop, the error remains even if I delete all the contents of the Views/Checkout folder, so I think it is an error of the checkout module and not something in the views
Scippy
  •  Scippy
  • 100% (Exalted)
  • Advanced Member Topic Starter
2021-02-25T12:04:03Z
I have to correct myself, the problem appears only if I open the checkout page with the admin user, i.e. without a checkout process in progress. Maybe that's right?
Will Strohl
2021-03-03T18:34:22Z
Originally Posted by: Scippy 

I have to correct myself, the problem appears only if I open the checkout page with the admin user, i.e. without a checkout process in progress. Maybe that's right?



This sounds like it maybe should be in a new forum thread, but...

The error message in this case appears to maybe be missing updates from merging your viewset.

https://hotcakescommerce...iew-doesn-t-work-anymore 
Will Strohl, Upendo Ventures
Hotcakes Cloud  | Get Support  | Code Support 
Official Cloud & Support provider for Hotcakes
Scippy
  •  Scippy
  • 100% (Exalted)
  • Advanced Member Topic Starter
2021-03-04T07:57:18Z
Quote:

This sounds like it maybe should be in a new forum thread, but...


...it could be, but the search in this forum doesn't work and the questions inevitably are duplicate ...

Quote:

The error message in this case appears to maybe be missing updates from merging your viewset.


how can it be an error in the viewset if the error persists even if I try to delete all the contents of the \ Views \ Checkout \ Index.cshtml ??
Will Strohl
2021-03-04T18:36:29Z
Deleting the contents is not a true test because it will result in a different result and error altogether. One thing that's important to remember is that Razor view cache can be pretty resiliant. This is why the PDBs are an important troubleshooting step, because that's one of the few ways I see that consistently clears the Razor cache.
Will Strohl, Upendo Ventures
Hotcakes Cloud  | Get Support  | Code Support 
Official Cloud & Support provider for Hotcakes
Scippy
  •  Scippy
  • 100% (Exalted)
  • Advanced Member Topic Starter
2021-03-17T14:40:01Z
Hi Will, I have identified how to reproduce the error. it is sufficient that once you arrive on the checkout page during a normal sales process, you clean the browser cookies and reload the checkout page, the error will appear.
It therefore seems that the exception is related to the lack of some cookie that is created during the purchase process.
so if you reach the checkout page directly without first adding a product to the cart, the exception is thrown, after adding a product to the cart, even if the cart is emptied, the exception disappears but clearing the browser cookies the exception returns.
Let me know if it needs to open an issue on Github.
Regards.
Josiah  Olhava
2021-04-20T05:21:52Z
@skippy Did you ever find a fix for this?
THANKS!
Will Strohl
2021-04-21T19:29:49Z
If the cookies are cleared during checkout, this makes sense, because checkout doesn't know what order it is supposed to be processing.
Will Strohl, Upendo Ventures
Hotcakes Cloud  | Get Support  | Code Support 
Official Cloud & Support provider for Hotcakes
MooreCreative
2021-05-23T20:50:15Z
Thanks Will for the script!

For anyone else that needs to perform this query through the DNN SQL Window in the Persona bar, here is a set of instructions and modified version that you can run:


-- Version to Run the AES corrections in the DNN SQL Window
  -- Step 0 default - assuming that there is only one Portal and one Hotcakes store instance
  -- that means that the StoreId would be value 1
  -- if not then this will need to be redone for each additional instance

  --Step 1, run this to confirm no AES value present
  SELECT * FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] LIKE N'AES%' ORDER BY [SettingName];

  -- Step 2, get this value
  SELECT CAST(LEFT((CONVERT(decimal(30,0),(((RAND()*999999999999)/0.00012345671)*999999999))),16) AS nvarchar(16)) AS NewAESValue
  -- my example value was 8789607022799839
  -- this value will then be placed in the Step 3 scripts

  -- Step 3, Run these in the DNN SQL Window
  -- place the NewAESValue number that was generated in Step 2 into these next scripts... here, replace the "8789607022799839" number
    IF EXISTS (SELECT 1 FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] = N'AESKey' AND [StoreId] = 1)
    BEGIN
      UPDATE [dbo].[hcc_StoreSettings] SET [SettingValue] = 8789607022799839 WHERE [SettingName] = N'AESKey' AND [StoreId] = 1;
    END
    ELSE
    BEGIN
      INSERT INTO [dbo].[hcc_StoreSettings] ([StoreId], [SettingName], [SettingValue])
      VALUES (1, N'AESKey', 8789607022799839);
    END  

    IF EXISTS (SELECT 1 FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] = N'AESInitVector' AND [StoreId] = 1)
    BEGIN
      UPDATE [dbo].[hcc_StoreSettings] SET [SettingValue] = 8789607022799839 WHERE [SettingName] = N'AESInitVector' AND [StoreId] = 1;
    END
    ELSE
    BEGIN
      INSERT INTO [dbo].[hcc_StoreSettings] ([StoreId], [SettingName], [SettingValue])
      VALUES (1, N'AESInitVector', 8789607022799839);
    END

    -- Step 4, run this query again to see the new values in place
    SELECT * FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] LIKE N'AES%' ORDER BY [SettingName];
    -- you should now see values in the records with the AESKey value entered
    -- AESInitVector
    -- AESKey

Loading
  • Sign-up for the Hotcakes Community Newsletter: