HighestSeverity, [self::HIGHEST_SEVERITY_ERROR, self::HIGHEST_SEVERITY_FAILURE])) { if (is_array($response->Notifications)) { $this->setIsSuccess(false)->setData([ 'errorCode' => $response->Notifications[0]->Code, 'errorText' => $response->Notifications[0]->Message, ]); } else { $this->setIsSuccess(false)->setData([ 'errorCode' => $response->Notifications->Code, 'errorText' => $response->Notifications->Message, ]); } } else { if (is_object($response->RateReplyDetails->RatedShipmentDetails)) { $ratedShipmentDetails = [$response->RateReplyDetails->RatedShipmentDetails]; } else { $ratedShipmentDetails = $response->RateReplyDetails->RatedShipmentDetails; } $shipmentRateDetail = $ratedShipmentDetails[0]->ShipmentRateDetail; $this->setIsSuccess()->setData([ 'serviceDetails' => $this->getServiceDetails(), 'rate' => [ '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; } }