Well, each function in the PHP SDK calls the _constructXml function, like so:
$this->_validationMode = $validationMode;
$this->_constructXml("createCustomerProfileRequest");
...
$this->_sendRequest();
The tricky thing is that the constructXml function does not actually add the validationMode tag. sendRequest calls the function in AuthorizeNetRequest.php, which calls this:
$this->_setPostString();
Which calls the function back in AuthorizeNetCIM.php, which adds the validateMode tag:
protected function _setPostString()
{
($this->_validationMode != "none" ? $this->_xml->addChild('validationMode',$this->_validationMode) : "");
$this->_post_string = $this->_xml->asXML();
// Add extraOptions CDATA
if ($this->_extraOptions) {
$this->_xml->addChild("extraOptions");
$this->_post_string = str_replace("<extraOptions></extraOptions>",'<extraOptions><![CDATA[' . $this->_extraOptions . ']]></extraOptions>', $this->_xml->asXML());
}
}
Don't ask me why they organized it like this. But the upshot is that these two things get added to the end of the XML.