public static function xml2array($xml) { return json_decode(json_encode(simplexml_load_string($xml, 'SimpleXMLElement', LIBXML_NOCDATA)), true); }
/** * Send the request with specified data * * @param mixed $data The data to send * * @return ResponseInterface */ public function sendData($data) { $request = $this->httpClient->post($this->endpoint)->setBody(Helper::array2xml($data)); $response = $request->send()->getBody(); $responseData = Helper::xml2array($response); return $this->response = new CreateOrderResponse($this, $responseData); }