toArray(); if ($response['Response']['ResponseStatusCode'] != self::SUCCESS_NODE_VALUE) { $this->setIsSuccess(false)->setData(array( 'errorCode' => $response['Response']['Error']['ErrorCode'], 'errorText' => $response['Response']['Error']['ErrorDescription'] )); } else { $this->setIsSuccess()->setData(array( 'serviceDetails' => $this->getServiceDetails(), 'ratedShipmentWarning' => $response['RatedShipment']['RatedShipmentWarning'], 'rate' => array( 'transportation' => $response['RatedShipment']['TransportationCharges']['MonetaryValue'], 'serviceOptions' => $response['RatedShipment']['ServiceOptionsCharges']['MonetaryValue'], 'total' => $response['RatedShipment']['TotalCharges']['MonetaryValue'] ), 'packageCount' => isset($response['RatedShipment']['RatedPackage'][0]) ? sizeof($response['RatedShipment']['RatedPackage']) : 1 )); } return $this; } }