Hi nop team,
Following error occured today:
Log niveau
Fout
Kort bericht
Nullable object must have a value.
Volledig bericht
System.InvalidOperationException: Nullable object must have a value. at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at Nop.Services.Payments.PaymentExtensions.CalculateAdditionalFee(IPaymentMethod paymentMethod, IOrderTotalCalculationService orderTotalCalculationService, IList`1 cart, Decimal fee, Boolean usePercentage) at Nop.Plugin.Payments.PayPalStandard.PayPalStandardPaymentProcessor.GetAdditionalHandlingFee(IList`1 cart) at Nop.Services.Payments.PaymentService.GetAdditionalHandlingFee(IList`1 cart, String paymentMethodSystemName) at Nop.Web.Factories.CheckoutModelFactory.PreparePaymentMethodModel(IList`1 cart, Int32 filterByCountryId) at Nop.Web.Controllers.CheckoutController.PaymentMethod() at lambda_method(Closure , ControllerBase , Object[] ) 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.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() 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.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.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.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.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
IP adres
***
Klant
***@hotmail.com
Pagina URL
https://www.***.be/checkout/paymentmethod
Verwijs URL
/ShmFrontEnd/start
Aangemaakt op
8/17/2017 10:32:18 AM
This is the code we have found, does anyone know how to solve this error?
We think the issue should be in the nopcommerce Paypal plugin or in the nopcommerce source code but cannot locate it.
Here is the code:
/// <summary>
/// Calculate payment method fee
/// </summary>
/// <param name="paymentMethod">Payment method</param>
/// <param name="orderTotalCalculationService">Order total calculation service</param>
/// <param name="cart">Shopping cart</param>
/// <param name="fee">Fee value</param>
/// <param name="usePercentage">Is fee amount specified as percentage or fixed value?</param>
/// <returns>Result</returns>
public static decimal CalculateAdditionalFee(this IPaymentMethod paymentMethod,
IOrderTotalCalculationService orderTotalCalculationService, IList<ShoppingCartItem> cart,
decimal fee, bool usePercentage)
{
if (paymentMethod == null)
throw new ArgumentNullException("paymentMethod");
if (fee <= 0)
return fee;
decimal result;
if (usePercentage)
{
//percentage
var orderTotalWithoutPaymentFee = orderTotalCalculationService.GetShoppingCartTotal(cart, usePaymentMethodAdditionalFee: false);
result = (decimal)((((float)orderTotalWithoutPaymentFee) * ((float)fee)) / 100f);
}
else
{
//fixed value
result = fee;
}
return result;
}
Hoping someone can help us out with this!
Thx Bart