I have setup magento 1.9.3.2 to use Fedex and despite getting a successful return from their webservices there are no shipping rates displayed on the front end, instead it shows the default error message
This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.
The test account on Fedex has been setup for the UK.
Any help would be appreciated.
This is what is returned:
[result] => stdClass Object ( [HighestSeverity] => WARNING [Notifications] => stdClass Object ( [Severity] => WARNING [Source] => crs [Code] => 872 [Message] => Rating is temporarily unavailable for one or more services: FEDEX_NEXT_DAY_EARLY_MORNING; FEDEX_NEXT_DAY_MID_MORNING; FEDEX_DISTANCE_DEFERRED; FEDEX_NEXT_DAY_FREIGHT; ; ; ; ; ; ; . Please try again later. [LocalizedMessage] => Rating is temporarily unavailable for one or more services: FEDEX_NEXT_DAY_EARLY_MORNING; FEDEX_NEXT_DAY_MID_MORNING; FEDEX_DISTANCE_DEFERRED; FEDEX_NEXT_DAY_FREIGHT; ; ; ; ; ; ; . Please try again later. [MessageParameters] => Array ( [0] => stdClass Object ( [Id] => SERVICE_TYPE_1 [Value] => FEDEX_NEXT_DAY_EARLY_MORNING ) [1] => stdClass Object ( [Id] => SERVICE_TYPE_2 [Value] => FEDEX_NEXT_DAY_MID_MORNING ) [2] => stdClass Object ( [Id] => SERVICE_TYPE_3 [Value] => FEDEX_DISTANCE_DEFERRED ) [3] => stdClass Object ( [Id] => SERVICE_TYPE_4 [Value] => FEDEX_NEXT_DAY_FREIGHT ) ) ) [Version] => stdClass Object ( [ServiceId] => crs [Major] => 10 [Intermediate] => 0 [Minor] => 0 ) [RateReplyDetails] => Array ( [0] => stdClass Object ( [PackagingType] => YOUR_PACKAGING [DestinationAirportId] => STN [IneligibleForMoneyBackGuarantee] => [OriginServiceArea] => A1 [DestinationServiceArea] => A1 [SignatureOption] => SERVICE_DEFAULT [ActualRateType] => PAYOR_ACCOUNT_SHIPMENT [RatedShipmentDetails] => Array ( [0] => stdClass Object ( [ShipmentRateDetail] => stdClass Object ( [RateType] => PAYOR_ACCOUNT_SHIPMENT [RateScale] => 0000000 [RateZone] => R0001 [PricingCode] => BASE [RatedWeightMethod] => ACTUAL [CurrencyExchangeRate] => stdClass Object ( [FromCurrency] => UKL [IntoCurrency] => UKL [Rate] => 1.0 ) [DimDivisor] => 0 [FuelSurchargePercent] => 6.5 [TotalBillingWeight] => stdClass Object ( [Units] => KG [Value] => 2.9 ) [TotalBaseCharge] => stdClass Object ( [Currency] => UKL [Amount] => 22.13 ) [TotalFreightDiscounts] => stdClass Object ( [Currency] => UKL [Amount] => 0.0 ) [TotalNetFreight] => stdClass Object ( [Currency] => UKL [Amount] => 22.13 ) [TotalSurcharges] => stdClass Object ( [Currency] => UKL [Amount] => 7.44 ) [TotalNetFedExCharge] => stdClass Object ( [Currency] => UKL [Amount] => 29.57 ) [TotalTaxes] => stdClass Object ( [Currency] => UKL [Amount] => 5.91 ) [TotalNetCharge] => stdClass Object ( [Currency] => UKL [Amount] => 35.48 ) [TotalRebates] => stdClass Object ( [Currency] => UKL [Amount] => 0.0 ) [TotalDutiesAndTaxes] => stdClass Object ( [Currency] => UKL [Amount] => 0.0 ) [TotalNetChargeWithDutiesAndTaxes] => stdClass Object ( [Currency] => UKL [Amount] => 35.48 ) [Surcharges] => Array ( [0] => stdClass Object ( [SurchargeType] => FUEL [Description] => Fuel [Amount] => stdClass Object ( [Currency] => UKL [Amount] => 1.44 ) ) [1] => stdClass Object ( [SurchargeType] => INSURED_VALUE [Description] => Insured value [Amount] => stdClass Object ( [Currency] => UKL [Amount] => 6.0 ) ) ) [Taxes] => stdClass Object ( [TaxType] => VAT [Description] => United Kingdom VAT [Amount] => stdClass Object ( [Currency] => UKL [Amount] => 5.91 ) ) ) ) ... snipped for forum limits ...
After a little more research, It would seem this issue occurs within this loop:
if (is_array($response->RateReplyDetails)) { foreach ($response->RateReplyDetails as $rate) { $serviceName = (string)$rate->ServiceType; if (in_array($serviceName, $allowedMethods)) { $amount = $this->_getRateAmountOriginBased($rate); $costArr[$serviceName] = $amount; $priceArr[$serviceName] = $this->getMethodPrice($amount, $serviceName); } } asort($priceArr); } else { $rate = $response->RateReplyDetails; $serviceName = (string)$rate->ServiceType; if (in_array($serviceName, $allowedMethods)) { $amount = $this->_getRateAmountOriginBased($rate); $costArr[$serviceName] = $amount; $priceArr[$serviceName] = $this->getMethodPrice($amount, $serviceName); } }
$rate->ServiceType;
is not in the returned json from FedEx.