Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • saravana 26 posts 45 karma points
    Apr 03, 2013 @ 17:23
    saravana
    0

    Exception occoured while processing pipeline 'UCommerce.Pipelines.Checkout.CheckoutPipeline'

     

    We are using uCommerce 3.0.0.12320 and made a cutom VAT calculation.

    The Basket.config is modified as below

    ${Basket.CustomTaxCalculation}
    ${Basket.CalculateVATTotal}
        <component id="Basket.CustomTaxCalculation"
    service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"
    type="HarryWinston.Web.OrderTax.TaxCalculation, HarryWinston.Web.OrderTax" />  

    <component id="Basket.CalculateVATTotal"
    service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"
    type="UCommerce.Pipelines.Basket.CalculateOrderVatTotalTask, UCommerce.Pipelines" />

     


    The issue is during the checkout process

    TransactionLibrary.ExecuteBasketPipeline();
    TransactionLibrary.Checkout();

    Please review the stacktrace below:

    "   at UCommerce.Pipelines.Pipeline`1.Execute(T subject)
       at UCommerce.Transactions.CheckoutService.Checkout(Basket basket)
       at UCommerce.Transactions.TransactionLibraryInternal.Checkout()
       at Castle.Proxies.TransactionLibraryInternalProxy.Checkout_callback()
       at Castle.Proxies.Invocations.TransactionLibraryInternal_Checkout.InvokeMethodOnTarget()
       at Castle.DynamicProxy.AbstractInvocation.Proceed()
       at UCommerce.Infrastructure.Interceptor.ExceptionLoggingInterceptor.Intercept(IInvocation invocation)
       at Castle.DynamicProxy.AbstractInvocation.Proceed()
       at Castle.Proxies.TransactionLibraryInternalProxy.Checkout()
       at UCommerce.Api.TransactionLibrary.Checkout()

     

  • Morten Skjoldager 440 posts 1499 karma points
    Apr 04, 2013 @ 08:14
    Morten Skjoldager
    0

    Hi Saravana 

    It doesn't provide much information. Can you find a more specific explanation, in the UmbracoLog maybe? I cannot read what exception is throwed, where and why :) 

  • saravana 26 posts 45 karma points
    Apr 04, 2013 @ 11:32
    saravana
    0

    Hi Morkten Thanks for your reply.

    We are getting the below issue during order checkout, The exception we obtained from the umbracolog is below

    Exception occoured while processing pipeline 'UCommerce.Pipelines.Checkout.CheckoutPipeline'. 
    See inner exception for details. UCommerce.Pipelines.PipelineExecutionResult Execute(T)
    at UCommerce.Pipelines.Pipeline`1.Execute(T subject)
    at UCommerce.Transactions.CheckoutService.Checkout(Basket basket)
    at UCommerce.Transactions.TransactionLibraryInternal.Checkout()
    at Castle.Proxies.TransactionLibraryInternalProxy.Checkout_callback()
    at Castle.Proxies.Invocations.TransactionLibraryInternal_Checkout.InvokeMethodOnTarget()
    at Castle.DynamicProxy.AbstractInvocation.Proceed()
    at UCommerce.Infrastructure.Interceptor.ExceptionLoggingInterceptor.Intercept(IInvocation invocation)
    UCommerce.Pipelines.PipelineExecutionResult Execute(UCommerce.EntitiesV2.PurchaseOrder)
    at UCommerce.Pipelines.Checkout.ValidatePaymentsMadeAgainstOrderTotalTask.Execute(PurchaseOrder subject)
    at UCommerce.Pipelines.Pipeline`1.Execute(T subject)
    at UCommerce.Infrastructure.Interceptor.ExceptionLoggingInterceptor.Intercept(IInvocation invocation)
    at Castle.DynamicProxy.AbstractInvocation.Proceed()
    at Castle.Proxies.TransactionLibraryInternalProxy.Checkout()
    at UCommerce.Api.TransactionLibrary.Checkout()
    at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
    at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary`2 parameters)
    at System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary`2 parameters)
    at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)
    at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)
    at System.Web.Script.Services.RestHandler.ProcessRequest(HttpContext context)
    at System.Web.Script.Services.ScriptHandlerFactory.HandlerWrapper.ProcessRequest(HttpContext context)
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    at System.Web.HttpApplication.PipelineStepManager.ResumeSteps(Exception error)
    at System.Web.HttpApplication.BeginProcessRequestNotification(HttpContext context, AsyncCallback cb)
    at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)
    at System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPtr moduleData, Int32 flags)
    at System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr managedHttpContext, IntPtr nativeRequestContext, IntPt...
  • Morten Skjoldager 440 posts 1499 karma points
    Apr 04, 2013 @ 12:43
    Morten Skjoldager
    0

    It looks like it has something to do with the task ValidatePaymentsMadeAgainstOrderTotalTask which throws an exception if payments made are less than order total. The code looks like this:

    if (paymentsMadeTotal < subject.OrderTotal) 
    throw new SecurityException(string.Format("Payment insufficient to cover order total for OrderGuid {0}. Please ensure that payments cover the entire value of the order before checking out.", subject.OrderGuid));
  • saravana 26 posts 45 karma points
    Apr 04, 2013 @ 12:56
    saravana
    0

    Hi Morket Thanks again.

    will try as you said

  • saravana 26 posts 45 karma points
    Apr 04, 2013 @ 12:57
    saravana
    0

    Hi Morket Thanks again.

    will try as you said

  • Kim Søjborg Pedersen 71 posts 275 karma points
    Apr 04, 2013 @ 13:06
    Kim Søjborg Pedersen
    0

    I ran into the same problem for a while ago and I never got it to work. My solution until now is to outcomment the line in the checkout pipeline.

    <!-- <value>${Checkout.ValidatePaymentsMadeAgainstOrderTotal}</value> -->

  • Morten Skjoldager 440 posts 1499 karma points
    Apr 04, 2013 @ 13:11
    Morten Skjoldager
    0

    Kim did you think about that ValidatePaymentsMadeAgainstOrderTotal is your last security step for possible frauds or buggy code? That task should never throw that exception as it checks weather the payments made from the paymentgateway matches the amount of the basket. It would be terribly to get that into production. 

  • Kim Søjborg Pedersen 71 posts 275 karma points
    Apr 08, 2013 @ 10:24
    Kim Søjborg Pedersen
    0

    yes I have to find a solution or writing my own check before going in production.

  • Morten Skjoldager 440 posts 1499 karma points
    Apr 08, 2013 @ 12:45
    Morten Skjoldager
    0

    @Saravana

    Any updates so far :) ?  

  • saravana 26 posts 45 karma points
    Apr 08, 2013 @ 16:13
    saravana
    0

    Kim and Morten
    Thanks so much for your reply.

    Initialy I have never commented the "<value>${Checkout.ValidatePaymentsMadeAgainstOrderTotal}</value>" and checked by adding my custom VAT calculation, it shows the same error which i have above.
    As Kim said i've commented that line, it works with no issues.
    But that will cause some in issues in future as Morten replied, so I don't what changes to be made in code that won't break the flow.

    Please help me.

     

  • Kim Søjborg Pedersen 71 posts 275 karma points
    Apr 08, 2013 @ 16:30
    Kim Søjborg Pedersen
    0

    I think the cause for your exception could be a decimal problem between your tax calculation and the build in "ValidatePaymentsMadeAgainstOrderTotal" method.

  • saravana 26 posts 45 karma points
    Apr 08, 2013 @ 16:53
    saravana
    0

    Hi Kim,

    Below is the code iam using for tax calculation

    namespace MyPipeline.Web.OrderTax
    {
        public class TaxCalculation : IPipelineTask<PurchaseOrder>
        {
            public PipelineExecutionResult Execute(PurchaseOrder Order)
            {
    decimal tax = 0;
    var totalTax = xxx; /*obtained from another service*/
    tax = (decimal)Convert.ToDecimal(totalTax);
    Order.VAT = tax; 
    Order.Save(); 
    return PipelineExecutionResult.Success; } } } 

    And I have modified the Basket.config as below

    <configuration>
      <components>
        <!-- Pipeline Instance -->
        <component id="Basket" service="UCommerce.Pipelines.IPipeline`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce"
                       type="UCommerce.Pipelines.Basket.BasketPipeline, UCommerce.Pipelines">
          <parameters>
            <tasks>
              <array>
                <value>${Basket.SetCultureCode}</value>
    
                <!-- Calculate shipping fees and tax -->
                <value>${Basket.CalculateShippingCostForShipments}</value>
                <value>${Basket.CalculateShippingTaxForShipments}</value>
                <value>${Basket.CalculateShippingTotalForShipments}</value>
    
                <!-- Calculate tax for order lines based on original unit prices -->
                <value>${Basket.CalculateOrderLineTax}</value>
    
                <!-- Calculate totals for order lines and order based on original prices -->
                <value>${Basket.CalculateOrderLinesTotals}</value>
                <value>${Basket.CalculateShippingTotal}</value>
                <value>${Basket.CalculatePaymentTotal}</value>
    
                <!-- Apply discounts -->
                <value>${Basket.ApplyAwards}</value>
    
                <!-- Calculate order level discount total based on applied discounts -->
                <value>${Basket.CalculateOrderLinesUnitDiscounts}</value>
    
                <!-- Calculcate order line discounts based on applied discounts -->
                <value>${Basket.CalculateOrderDiscount}</value>
                <value>${Basket.CalculateOrderLinesDiscounts}</value>
    
                <!-- Calculate total value of items excluding taxes -->
                <value>${Basket.CalculateOrderSubTotal}</value>
    
                <!-- Shipping taxes and totals need to be recalculated if discounts are applied to shipments -->
                <value>${Basket.CalculateShippingDiscounts}</value>
                <value>${Basket.CalculateShippingTaxForShipments}</value>
                <value>${Basket.CalculateShippingTotalForShipments}</value>
    
                <!-- Recalculate tax for order lines based on reduced unit prices -->
                <value>${Basket.CalculateOrderLineTax}</value>
    
                <!-- Calculate totals for order lines and order -->
                <value>${Basket.CalculateOrderLinesTotals}</value>
                <value>${Basket.CalculateShippingTotal}</value>
                <value>${Basket.CalculatePaymentTotal}</value>
    
                <!--<value>${Basket.CalculateVATTotal}</value>-->
                <value>${CustomTaxCalculation}</value><!--Custom Tax Calculation-->
                <value>${Basket.CalculateOrderDiscountTotal}</value>
    
                <value>${Basket.CalculateOrderTaxTotal}</value>
                <value>${Basket.CalculateOrderTotal}</value>
    
                <value>${Basket.CleanUp}</value>
                <value>${Basket.Save}</value>
              </array>
            </tasks>
          </parameters>
        </component>
    
        <!-- Pipeline Tasks-->
        <component id="Basket.CleanUp" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CleanUpTask, UCommerce.Pipelines" />
    
        <component id="Basket.ApplyAwards" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.ApplyAwardsTask, UCommerce.Pipelines" />
    
        <component id="Basket.SetCultureCode" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.SetCultureCodeTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculateOrderLinesUnitDiscounts" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateOrderLinesUnitDiscountsTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculateShippingDiscounts" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateShippingDiscountTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculateOrderLinesDiscounts" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateOrderLinesDiscountsTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculateOrderLinesTotals" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateOrderLineTotalsTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculateShippingTaxForShipments" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateShippingTaxForShipmentsTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculateShippingCostForShipments" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateShippingCostForShipmentsTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculateShippingTotalForShipments" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateShippingTotalForShipmentsTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculateShippingTotal" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateShippingTotalTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculatePaymentTotal" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculatePaymentTotalTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculateOrderLineTax" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateOrderLineTaxTask, UCommerce.Pipelines" />
    
        <component id="Basket.CalculateVATTotal" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateOrderVatTotalTask, UCommerce.Pipelines" />
    
        <!--Custom Tax Calculation-->
        <component id="CustomTaxCalculation" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="MyPipeline.Web.OrderTax.TaxCalculation, MyPipeline.Web.OrderTax" />
    <component id="Basket.CalculateOrderDiscount" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateOrderDiscountTask, UCommerce.Pipelines" /> <component id="Basket.CalculateOrderDiscountTotal" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateOrderDiscountTotalTask, UCommerce.Pipelines" /> <component id="Basket.CalculateOrderSubTotal" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateOrderSubTotalTask, UCommerce.Pipelines" /> <component id="Basket.CalculateOrderTaxTotal" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateOrderTaxTotalTask, UCommerce.Pipelines" /> <component id="Basket.CalculateOrderTotal" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Basket.CalculateOrderTotalTask, UCommerce.Pipelines" /> <component id="Basket.Save" service="UCommerce.Pipelines.IPipelineTask`1[[UCommerce.EntitiesV2.PurchaseOrder, UCommerce]], UCommerce" type="UCommerce.Pipelines.Common.SavePurchaseOrderTask, UCommerce.Pipelines" /> </components> </configuration>

    Please review the code and help me where I went wrong.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 09, 2013 @ 12:48
    Søren Spelling Lund
    0

    Looks like you're running the CheckoutService manually to complete the order, which is fine for specific cases where you're not authorizing payment using a payment processor like Authorize.net, PayPal, or other.

    However, the most common scenario is that a payment processor is involved and I'm guessing it's the case for you too. You're probably trying to do checkout twice: Once automatically using the uCommerce payment system and a second time using CheckoutService.Checkout(basket). That second checkout is probably what's failing.

    If you are indeed using a payment gateyway to authorize payment checkout is typically handled by the payment provider in uCommerce itself when a successful callback is received from the payment gateway. What happens is that the configured pipeline (i.e. checkout) is executed and will handle all the checkout logic for you.

    Here's what a sample config for Auth.net looks like in uCommerce:

    Hope this helps.

  • saravana 26 posts 45 karma points
    Apr 10, 2013 @ 16:17
    saravana
    0

    Hi Soren,

    Thanks for your reply.

    Now we are using Cybersource for payment process, which is not in ucommerce.

    So I think the checkout won't happens during payment.

    Please clarify

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 11, 2013 @ 11:59
    Søren Spelling Lund
    0

    Sorry I misread your question. Morten is right that the ValidatePaymentsMadeAgainstOrderTotal is failing. For now commenting it out of the checkout pipeline will solve the issue. I will schedule a work item to make sure that task works as exception in the future.

    Sorry for the inconvenience.

  • saravana 26 posts 45 karma points
    Apr 11, 2013 @ 16:05
    saravana
    0

    Thanks Soren.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Apr 12, 2013 @ 08:47
    Søren Spelling Lund
    0

    Could I pursuade you to send me your database along with the orderguid of the basket that's failing? Having some of your test data will speed along the fix.

    You can send it to me via e-mail at ssl AT ucommerce DOT dk

Please Sign in or register to post replies

Write your reply to:

Draft