Envia o boleto para o pagseguro.

@throws \Artistas\PagSeguro\PagSeguroException

@return \SimpleXMLElement
513098
public function send()
    {
        if (empty($this->firstDueDate)) {
            self::setFirstDueDate(\Carbon\Carbon::now()->addDays(3));
        }

        if (empty($this->numberOfPayments)) {
            self::setNumberOfPayments(1);
        }

        $this->validatePaymentSettings();

        $config = [
            'reference'         => $this->reference,
            'amount'            => $this->amount,
            'notificationURL'   => $this->notificationURL,
            'description'       => $this->description,
            'instructions'      => $this->instructions,
            'periodicity'       => 'monthly',
            'numberOfPayments'  => $this->numberOfPayments,
            'firstDueDate'      => $this->firstDueDate,
        ];

        $custumerArray = array_merge($this->custumer['customer'], ['address' => $this->custumer['address']]);

        $data = array_filter(array_merge($config, ['customer' => $custumerArray]));

        return $this->sendJsonTransaction($data, $this->url['boletos'], 'POST', ['Accept: application/json;charset=ISO-8859-1', 'Content-type: application/json;charset=ISO-8859-1']);
    }
1102043
public function generatePlainPartFromBody()
    {
        $plainPart = $this->findPlainPart();
        if ($plainPart) {
            $this->getSwiftMessage()->detach($plainPart);
        }
        unset($plainPart);

        $this->getSwiftMessage()->addPart(
            Convert::xml2raw($this->getBody()),
            'text/plain',
            'utf-8'
        );

        return $this;
    }
890286
public function getXmlMapperInstance()
    {
        if (!isset($this->_xmlMapper)) {
            $this->_xmlMapper = new XmlMapper($this->_getXmlConfigDriver());
        }
        return $this->_xmlMapper;
    }
808030
public function getXMLContent()
    {
        if ($this->xmlContent === null) {
            try {
                if (($content = $this->getContent()) === '') {
                    return $this->xmlContent = false;
                }
                $errors = libxml_use_internal_errors(true);
                $this->xmlContent = new \SimpleXMLElement($content);
                libxml_use_internal_errors($errors);
            } catch (\Exception $E) {
                return $this->xmlContent = false;
            }
        }

        return $this->xmlContent;
    }
1042613
public function toMusicXML() {
        $out  = '';
        $out .= '<key>';
        if (isset($this->fifths)) {
            $out .= '<fifths>'.$this->fifths.'</fifths>';
        }

        if (isset($this->mode)) {
            $out .= '<mode>'.$this->mode.'</mode>';
        }

        $out .= '</key>';
        return $out;
    }
996972
public function toString()
    {

        $request = array();
        $request['Reference'] = $this->reference;
        $request['PagSeguroPreApprovalCode'] = $this->preApprovalCode;

        return "PagSeguroPaymentCharge: " . var_export($request, true);
    }
791059
protected function _toXMLFragment() 
    {
        $xml = "";
        foreach ($this->_fields as $fieldName => $field) {
            $fieldValue = $field['FieldValue'];
            if (!is_null($fieldValue)) {
                $fieldType = $field['FieldType'];
                if (is_array($fieldType)) {
                    if ($this->_isComplexType($fieldType[0])) {
                        foreach ($fieldValue as $item) {
                            $xml .= "<$fieldName>";
                            $xml .= $item->_toXMLFragment();
                            $xml .= "</$fieldName>";
                        }
                    } else {
                        foreach ($fieldValue as $item) {
                            $xml .= "<$fieldName>";
                            $xml .= $this->_escapeXML($item);
                            $xml .= "</$fieldName>";
                        }
                    }
                } else {
                    if ($this->_isComplexType($fieldType)) {
                        $xml .= "<$fieldName>";
                        $xml .= $fieldValue->_toXMLFragment();
                        $xml .= "</$fieldName>";
                    } else {
                        $xml .= "<$fieldName>";
                        $xml .= $this->_escapeXML($fieldValue);
                        $xml .= "</$fieldName>";
                    }
                }
            }
        }
        return $xml;
    }
1369818
public function getElement()
    {
        $this->startCommentBlock();
        foreach ($this->description as $line) {
            $this->addLine($line);
        }
        $this->addBlankLine();

        if (count($this->var_types) > 0) {
            $type_ltgh = max(array_map('mb_strlen', $this->var_types));
            $var_ltgh = max(array_map('mb_strlen', array_keys($this->var_types)));
            foreach ($this->var_types as $name => $type) {
                $type = str_pad($type, $type_ltgh);
                $param = str_pad($name, $var_ltgh);
                $this->addLine('@param '.$type.'$'.$param.' '.$this->var_descriptions[$name]);
            }
            $this->addBlankLine();
        }

        if (count($this->params) > 0) {
            $params_ltgh = array_map('strlen', array_keys($this->params));
            foreach ($this->params as $param => $value) {
                $this->addLine('@'.str_pad($param, max($params_ltgh)).' '.$value);
            }
        }

        $this->endCommentBlock();
        return $this->lines;
    }
1185752
public function toXML($mapKeysToText = false)
	{
		// Deprecation warning.
		Log::debug('Hubzero\Database\Table::toXML() is deprecated.');

		// Initialise variables.
		$xml = array();
		$map = $mapKeysToText ? ' mapkeystotext="true"' : '';

		// Open root node.
		$xml[] = '<record table="' . $this->_tbl . '"' . $map . '>';

		// Get the publicly accessible instance properties.
		foreach (get_object_vars($this) as $k => $v)
		{
			// If the value is null or non-scalar, or the field is internal ignore it.
			if (!is_scalar($v) || ($v === null) || ($k[0] == '_'))
			{
				continue;
			}

			$xml[] = '	<' . $k . '><![CDATA[' . $v . ']]></' . $k . '>';
		}

		// Close root node.
		$xml[] = '</record>';

		// Return the XML array imploded over new lines.
		return implode("\n", $xml);
	}
151064
public function xml()
    {
        if ($this->_result) {
            $positions = array(0=>0);
            $this->_addchild($this->_result['childs'], $this->xml, $positions);
        }

        return $this->xml->getSimpleXmlElement();
    }
2285
public function serializeToXml()
    {
        $xml = new \SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><WebsiteConfiguration></WebsiteConfiguration>');
        $index_document_part = $xml->addChild('IndexDocument');
        $error_document_part = $xml->addChild('ErrorDocument');
        $index_document_part->addChild('Suffix', $this->indexDocument);
        $error_document_part->addChild('Key', $this->errorDocument);
        return $xml->asXML();
    }
1283881
public function enviar()
    {
        // generar XML que se enviará
        if (!$this->xml_data)
            $this->xml_data = $this->generar();
        if (!$this->xml_data) {
            \sasco\LibreDTE\Log::write(
                \sasco\LibreDTE\Estado::DOCUMENTO_ERROR_GENERAR_XML,
                \sasco\LibreDTE\Estado::get(
                    \sasco\LibreDTE\Estado::DOCUMENTO_ERROR_GENERAR_XML,
                    substr(get_class($this), strrpos(get_class($this), '\\')+1)
                )
            );
            return false;
        }
        // validar schema del documento antes de enviar
        if (!$this->schemaValidate())
            return false;
        // solicitar token
        $token = \sasco\LibreDTE\Sii\Autenticacion::getToken($this->Firma);
        if (!$token)
            return false;
        // enviar AEC
        $email = $this->caratula['MailContacto'];
        $emisor = $this->caratula['RutCedente'];
        $result = $this->enviarRTC($email, $emisor, $this->xml_data, $token, 10);
        if ($result===false)
            return false;
        if (!is_numeric((string)$result->TRACKID))
            return false;
        return (int)(string)$result->TRACKID;
    }
593893
public function toXML()
	{
		$document = new \DOMDocument("1.0", 'UTF-8');

		$gpx = $document->createElementNS("http://www.topografix.com/GPX/1/1", "gpx");
		$gpx->setAttribute("version", "1.1");
		$gpx->setAttribute("creator", $this->creator ? $this->creator : phpGPX::getSignature());

		ExtensionParser::$usedNamespaces = [];

		if (!empty($this->metadata)) {
			$gpx->appendChild(MetadataParser::toXML($this->metadata, $document));
		}

		foreach ($this->waypoints as $waypoint) {
			$gpx->appendChild(PointParser::toXML($waypoint, $document));
		}

		foreach ($this->routes as $route) {
			$gpx->appendChild(RouteParser::toXML($route, $document));
		}

		foreach ($this->tracks as $track) {
			$gpx->appendChild(TrackParser::toXML($track, $document));
		}

		if (!empty($this->extensions)) {
			$gpx->appendChild(ExtensionParser::toXML($this->extensions, $document));
		}

		// Namespaces
		$schemaLocationArray = [
			'http://www.topografix.com/GPX/1/1',
			'http://www.topografix.com/GPX/1/1/gpx.xsd'
		];

		foreach (ExtensionParser::$usedNamespaces as $usedNamespace) {
			$gpx->setAttributeNS(
				"http://www.w3.org/2000/xmlns/",
				sprintf("xmlns:%s", $usedNamespace['prefix']),
				$usedNamespace['namespace']
			);

			$schemaLocationArray[] = $usedNamespace['namespace'];
			$schemaLocationArray[] = $usedNamespace['xsd'];
		}

		$gpx->setAttributeNS(
			'http://www.w3.org/2001/XMLSchema-instance',
			'xsi:schemaLocation',
			implode(" ", $schemaLocationArray)
		);

		$document->appendChild($gpx);

		if (phpGPX::$PRETTY_PRINT) {
			$document->formatOutput = true;
			$document->preserveWhiteSpace = true;
		}
		return $document;
	}
441225
public function toXml()
    {
        if ($this->blank())
            return;
        
        $t = get_class($this->current());
        
        $xml = '<?xml version="1.0" encoding="UTF-8"?>';
        $xml .= '<' . $t . '>';
        
        foreach ($this->members() as $obj) {
            $xml .= $obj->toXml(array('skip_instruct' => true));
        }
        
        $xml .= '</' . $t . '>';
        
        return $xml;
    }
875253
public function ToString()
	{
		$sb = array_reduce( $this->ToList(), function( $carry, /** @var XPath2Item $item */ $item )
		{
			$carry[] = $item->ToString();
			return $carry;
		}, array() );
		$s = implode( ", ", $sb );
		return $s;

		$sb = array();
		foreach ( $this->ToList() as $node )
		{
			$sb[] = is_object( $node ) ? $node->ToString() : $node;
		}

		$s = implode( ", ", $sb );

		return empty( $s)
			? "<empty>"
			: $s;
	}
1019891
protected function pretty()
    {
        $xml = $this->getParameter('value');
        $level = $this->getParameter('level') != null ? intval($this->getParameter('level')) : 6;

        // get an array containing each XML element
        $xml = explode("\n", preg_replace('/>\s*</', ">\n<", $xml));

        // hold current indentation level
        $indent = 0;

        // hold the XML segments
        $pretty = array();

        // shift off opening XML tag if present
        if (count($xml) && preg_match('/^<\?\s*xml/', $xml[0])) {
            $pretty[] = array_shift($xml);
        }

        foreach ($xml as $el) {
            if (preg_match('/^<([\w])+[^>\/]*>$/U', $el)) {
                if($indent < 0) $indent = 0;
                // opening tag, increase indent
                $pretty[] = str_repeat('&nbsp;', $indent) . htmlentities($el,ENT_QUOTES);
                $indent += $level;
            } else {
                if (preg_match('/^<\/.+>$/', $el)) {
                    // closing tag, decrease indent
                    $indent -= $level;
                }
                $pretty[] = str_repeat('&nbsp;', abs($indent)) . htmlentities($el,ENT_QUOTES);
            }
        }

        return implode("<br/>", $pretty);
    }
671222
public function getXMLContent()
    {
        if ($this->xmlContent === null) {
            try {
                if (($content = $this->content) === '') {
                    return $this->xmlContent = false;
                }

                $errors = libxml_use_internal_errors(true);
                $this->xmlContent = new SimpleXMLElement($content);
                libxml_use_internal_errors($errors);
            } catch (Exception $exception) {
                return $this->xmlContent = false;
            }
        }

        return $this->xmlContent;
    }