当我想从 FedEx 获取费率时,我收到此警告。
"Severity" => "WARNING"
"Source" => "crs"
"Code" => "396"
"Message" => "The returned rate types are in the requested preferred currency; preferred rates not returned."
"LocalizedMessage" => "The returned rate types are in the requested preferred currency; preferred rates not returned."
我使用 https://github.com/JeremyDunn/php-fedex-api-wrapper 从 FedEx 获取费率。
控制器:
$rateRequest->RequestedShipment->ShippingChargesPayment->PaymentType = PaymentType::_SENDER;
$rateRequest->RequestedShipment->PreferredCurrency = 'USD';
$rateRequest->RequestedShipment->RateRequestTypes = [RateRequestType::_PREFERRED, RateRequestType::_LIST];
只是一个解决方法
您可以将首选货币更改为包裹运送的国家/地区。
例如,如果包裹要运送到澳大利亚,则将首选货币中的澳元传递给货币,将美元传递为包裹或商品金额或保险价值的货币。那么它确实包括首选汇率以及兑换率,然后您可以在回复后兑换回美元
通过这样做,我在回复中得到了这个。如您所见,汇率可用,您可以兑换回美元
"ShipmentRateDetail": {
"RateType": "PREFERRED_ACCOUNT_SHIPMENT",
"RateScale": "US001OFJ_03_YOUR_PACKAGING",
"RateZone": "US001O",
"RatedWeightMethod": "ACTUAL",
"CurrencyExchangeRate": {
"FromCurrency": "USD",
"IntoCurrency": "AUD",
"Rate": "1.53"
},
"DimDivisor": 166,
"DimDivisorType": "PRODUCT",
"FuelSurchargePercent": "21.0",
"TotalBillingWeight": {
"Units": "LB",
"Value": "15.0"
},
"TotalBaseCharge": {
"Currency": "AUD",
"Amount": "713.23"
},
"TotalFreightDiscounts": {
"Currency": "AUD",
"Amount": "611.96"
},
"TotalNetFreight": {
"Currency": "AUD",
"Amount": "101.27"
},
"TotalSurcharges": {
"Currency": "AUD",
"Amount": "25.26"
},
"TotalNetFedExCharge": {
"Currency": "AUD",
"Amount": "126.53"
},
"TotalTaxes": {
"Currency": "AUD",
"Amount": "0.0"
},
"TotalNetCharge": {
"Currency": "AUD",
"Amount": "126.53"
},
"TotalRebates": {
"Currency": "AUD",
"Amount": "0.0"
},
"TotalDutiesAndTaxes": {
"Currency": "AUD",
"Amount": "0.0"
},
"TotalAncillaryFeesAndTaxes": {
"Currency": "AUD",
"Amount": "0.0"
},
"TotalDutiesTaxesAndFees": {
"Currency": "AUD",
"Amount": "0.0"
},
"TotalNetChargeWithDutiesAndTaxes": {
"Currency": "AUD",
"Amount": "126.53"
},
"FreightDiscounts": {
"RateDiscountType": "VOLUME",
"Description": "Volume",
"Amount": {
"Currency": "AUD",
"Amount": "611.96"
},
"Percent": "85.8"
},
"Surcharges": [
{
"SurchargeType": "INSURED_VALUE",
"Description": "Insured value",
"Amount": {
"Currency": "AUD",
"Amount": "3.99"
}
},
{
"SurchargeType": "OTHER",
"Description": "Demand Surcharge",
"Amount": {
"Currency": "AUD",
"Amount": "0.0"
}
},
{
"SurchargeType": "FUEL",
"Description": "Fuel",
"Amount": {
"Currency": "AUD",
"Amount": "21.27"
}
}
]
}
}