Developer forum

Forum » Integration » Feeprovider issue after payment

Feeprovider issue after payment

Keld Gøtterup
Reply

We have made a live integration project where we get all prices and fees from Navision.
we do however have a problem with Dynamicweb not getting to correct shipping fee.
in general frontend looks fine until the callback from the payment gateway, when it should be getting back to the receipt page something goes wrong.
it gives a blank page (error template) and in the backend i can see that the order is not complete.

when viewing the log for the order i have this error: Dynamicweb.eCommerce.Cart.CheckoutHandlers.QuickPay3 An error with the message 'The amount returned from callback does not match the amount set on the order: Callback: 19900, order: 9900' occurred. See the error log for details.

as far as i can see from this (and testing) is that the callback is correct, but order is wrong and is taken from the standard shipping fee and not the navision fee.



how its done:

in the ProcessResponse function i have the following code:


                    string shipFee = orderNode.SelectSingleNode("column [@columnName='OrderShippingFee']").InnerText;
                    if (!string.IsNullOrEmpty(shipFee))
                    {
                        order.ShippingFee.PriceWithVAT = Base.DoubleFromString(shipFee);

                        HttpContext.Current.Session.Add("ShipFee",shipFee);
                    }

 

 

And the FeeProvider:
 

public class NavisionFee : FeeProvider
    {

        public override PriceRaw FindFee(Order Order)
        {
            PriceRaw ReturnFee = null;
            //Send ordre afsted til webservice og få fragt tilbage
            LogToFile.Log("FindFee", "/feeprovider", LogToFile.LogType.ManyEntriesPerFile);
            
            if (HttpContext.Current.Session["ShipFee"] != null)
            {
                LogToFile.Log("FindFee - " + HttpContext.Current.Session["ShipFee"].ToString(), "/feeprovider", LogToFile.LogType.ManyEntriesPerFile);
                ReturnFee = new PriceRaw(Base.DoubleFromString(HttpContext.Current.Session["ShipFee"].ToString()), Dynamicweb.eCommerce.Common.Application.DefaultCurrency);
            }

            return ReturnFee;
        }
    }






What can i do to fix this inconsistency?


Replies

 

You must be logged in to post in the forum