upgraded from 3.6 to 3.8 and FedEx quotes no longer include insurance

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Any one else have this problem?  I compiled from source and I checked the FedEx plugin source and plenty of

            request.RequestedShipment.TotalInsuredValue = new Money();
            request.RequestedShipment.TotalInsuredValue.Amount = orderSubTotal;
            request.RequestedShipment.TotalInsuredValue.Currency = currencyCode;

in several locations leading me to believe the order value is being passed to FedEx.  I ran a simple test and created a 0 weight high value product and no many how many I add to the cart the shipping quote does not change.
7 years ago
It appears the FedEx API may have changed, in any event I found the problem.

In file nopCommerce_3.80_Source\Plugins\Nop.Plugin.Shipping.Fedex\FedexComputationMethod.cs

wherever you see

.InsuredValue.Amount = <some value> ;

you need to add a new line

InsuredValue.AmountSpecified = true;

A bizarre protocol if you ask me.  Seems like if you set the amount then by definition the amount is specified but it appears the folks at FedEx want redundant confirmation of that.

so for example

                request.RequestedShipment.RequestedPackageLineItems[0].InsuredValue = new Money(); // insured value
                request.RequestedShipment.RequestedPackageLineItems[0].InsuredValue.Amount = orderSubTotal;
                request.RequestedShipment.RequestedPackageLineItems[0].InsuredValue.AmountSpecified = true; // <<<<<<< ADD THIS LINE
                request.RequestedShipment.RequestedPackageLineItems[0].InsuredValue.Currency = currencyCode;

This happens in 5 locations in  the code.

The response was also throwing a warning that preferred currency was not set, I fixed this by adding the  line shown below.

            request.RequestedShipment.TotalInsuredValue = new Money();
            request.RequestedShipment.TotalInsuredValue.Amount = orderSubTotal;
            request.RequestedShipment.TotalInsuredValue.Currency = currencyCode;
            request.RequestedShipment.PreferredCurrency = currencyCode;  // <<<<<<<<<<<<ADD THIS LINE
            request.RequestedShipment.TotalInsuredValue.AmountSpecified = true;
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.