Copied to clipboard

Flag this post as spam?

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


  • Gordon Saxby 1186 posts 1360 karma points
    Jun 20, 2018 @ 08:36
    Gordon Saxby
    0

    Error when adding to the Basket

    I have copied our Live site to a Staging server and used the TeaCommerce UI to delete all orders and carts. I also reset the nextorder number to 0.

    I now get the following error when trying to add anything to the basket:

    ERROR TeaCommerce.Umbraco.Configuration.Infrastructure.Logging.LoggingProvider - Tea Commerce FormPost error
     --- Form data:
     -- AddOrUpdateOrderLine = "productIdentifier, quantity"
     -- storeId = "1"
     -- productIdentifier = "9859"
     -- quantity = "1"
     -- stock = "9999956"
     -- isJavaScript = "true"
     - Exception: System.ArgumentNullException: Value cannot be null.
    Parameter name: paymentMethod
       at TeaCommerce.Api.PriceCalculators.PaymentCalculator.CalculateVatRate(PaymentMethod paymentMethod, Order order)
       at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculatePaymentCost(Order order, Currency currency)
       at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrder(Order order, OrderCalculationMode calculationMode)
       at TeaCommerce.Api.Models.Order.Save()
       at ZeroCostPayment.EventHandlers.ZeroCostPaymentHandler.Order_Updated(Order order, OrderUpdatedEventArgs orderUpdatedEventArgs)
       at TeaCommerce.Api.Notifications.OrderUpdatedEventHandler.Invoke(Order order, OrderUpdatedEventArgs e)
       at TeaCommerce.Api.Models.Order.CompareAndNotifyAfterSave(Order orderToCompare)
       at TeaCommerce.Api.Models.Order.Save()
       at TeaCommerce.Api.Web.TeaCommerceHelper.GetCurrentOrder(Int64 storeId, Boolean autoCreate)
       at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderLine(Int64 storeId, String productIdentifier, Nullable`1 quantity, IDictionary`2 properties, Boolean overwriteQuantity, String bundleIdentifier, String parentBundleIdentifier)
       at TeaCommerce.Api.Web.FormPostHandler.AddOrUpdateOrderLine(Int64 storeId, IDictionary`2 formFields, IDictionary`2 settings)
       at TeaCommerce.Api.Web.FormPostHandler.FormPost()
    

    Any ideas on what could be causing the error?

  • Rune Grønkjær 1294 posts 2856 karma points
    Jun 20, 2018 @ 11:02
    Rune Grønkjær
    0

    Hi Gordon,

    Looks like the calculator cannot find the payment method when trying to calculate the VAT rate. Maybe you have deleted som payment methods as well? Or maybe theres not set a default payment method any more.

    It needs the payment method to get the vat group.

    /Rune

  • Gordon Saxby 1186 posts 1360 karma points
    Jun 20, 2018 @ 11:35
    Gordon Saxby
    0

    I have checked / compared the settings already, but will again to be sure.

    Looks like the calculator cannot find the payment method when trying to calculate the VAT rate. Maybe you have deleted som payment methods as well? Or maybe theres not set a default payment method any more.

    The site "should" be a copy of live, with various settings changed so that it points at test / sandbox services rather than live ones. Nothing else should have changed, hence my confusion!

    Where is the default payment method setup?

  • Rune Grønkjær 1294 posts 2856 karma points
    Jun 20, 2018 @ 12:39
    Rune Grønkjær
    0

    Your countries should have a default payment method.

    I think that the calculator is getting a payment method id, that have been deleted somehow. Check the orders payment method id here: order.PaymentInformation.PaymentMethodId

    /Rune

  • Gordon Saxby 1186 posts 1360 karma points
    Jul 31, 2018 @ 15:00
    Gordon Saxby
    0

    This issue went quiet for a while - but has come back!

    I have compared all the settings that I can find n Umbraco and the 2 environments are setup the same. The Staging site does not have a licence but I have removed all orders and reset the next order number in the DB.

    Is there any way to enable more detailed debugging information, or can you supply a set of debug DLLs?

    Can you suggest any other tests / config items to check, either via Umbraco or in the DB itself?

  • Brian Lyk Larsen 19 posts 254 karma points
    Aug 01, 2018 @ 09:51
    Brian Lyk Larsen
    100

    Hi Gordon,

    The ZeroCostPayment package may be the cause of the problem.

    Does ZeroCostPayment.config reference a payment method that no longer exists?

  • Gordon Saxby 1186 posts 1360 karma points
    Aug 01, 2018 @ 10:17
    Gordon Saxby
    0

    Umm, possibly?! What does the "methodId" value refer to, in the config file?

    Edit: I assume the methodId is the database ID of the payment method in the TeaCommerce_PaymentMethod table?

    If so, then it's not the problem, as my local site (which works) has an ID in the config file that does not exist in the TeaCommerce_PaymentMethod table.

  • Brian Lyk Larsen 19 posts 254 karma points
    Aug 01, 2018 @ 10:46
    Brian Lyk Larsen
    0

    The methodId is indeed the ID of the payment method in the database.

    ZeroCostPayment only triggers when the order total is 0. Are you adding a product without a price on the staging server?

  • Gordon Saxby 1186 posts 1360 karma points
    Aug 01, 2018 @ 10:50
    Gordon Saxby
    0

    No - the product has a price.

    For now (and to match the live environment) I have disabled it in the TeaCommerce_PaymentMethod table. Items will now add to the basket.

    I will have to revisit the issue if / when the ZeroCost plugin required in the future.

Please Sign in or register to post replies

Write your reply to:

Draft