HighestSeverity, array(self::HIGHEST_SEVERITY_ERROR, self::HIGHEST_SEVERITY_FAILURE))) { if (is_array($response->Notifications)) { $this->setIsSuccess(false)->setData(array( 'errorCode' => $response->Notifications[0]->Code, 'errorText' => $response->Notifications[0]->Message )); } else { $this->setIsSuccess(false)->setData(array( 'errorCode' => $response->Notifications->Code, 'errorText' => $response->Notifications->Message )); } } else { if (is_object($response->RateReplyDetails->RatedShipmentDetails)) { $ratedShipmentDetails = array($response->RateReplyDetails->RatedShipmentDetails); } else { $ratedShipmentDetails = $response->RateReplyDetails->RatedShipmentDetails; } $shipmentRateDetail = $ratedShipmentDetails[0]->ShipmentRateDetail; $this->setIsSuccess()->setData(array( 'serviceDetails' => $this->getServiceDetails(), 'rate' => array( 'baseCharge' => $shipmentRateDetail->TotalBaseCharge->Amount, 'freightDiscounts' => $shipmentRateDetail->TotalFreightDiscounts->Amount, 'netFreight' => $shipmentRateDetail->TotalNetFreight->Amount, 'surcharges' => $shipmentRateDetail->TotalSurcharges->Amount, 'netFedExCharge' => $shipmentRateDetail->TotalNetFedExCharge->Amount, 'taxes' => $shipmentRateDetail->TotalTaxes->Amount, 'total' => $shipmentRateDetail->TotalNetCharge->Amount, ) )); } return $this; } }