There's a bug in AuthorizeNetCIM::_setPostString() method. On my PHP installation, the empty extraOptions tag is being rendered as
<extraOptions/>
That doesn't match the str_replace call. Since both versions are valid XML, here's a patch that uses the DOM API to add the CDATA section:
diff --git lib/AuthorizeNetCIM.php lib/AuthorizeNetCIM.php
index 653e731..379ec02 100644
--- lib/AuthorizeNetCIM.php
+++ lib/AuthorizeNetCIM.php
@@ -339,8 +339,10 @@ class AuthorizeNetCIM extends AuthorizeNetRequest
// Add extraOptions CDATA
if ($this->_extraOptions) {
- $this->_xml->addChild("extraOptions");
- $this->_post_string = str_replace("",'' . $this->_extraOptions . '', $this->_xml->asXML());
+ $dom = dom_import_simplexml($this->_xml);
+ $extraOptions = $dom->appendChild($dom->ownerDocument->createElement("extraOptions"));
+ $extraOptions->appendChild($dom->ownerDocument->createCDATASection($this->_extraOptions));
+ $this->_post_string = $this->_xml->asXML();
}
}
I don't see a public bug tracker anywhere, but if there is please point me to it and I'll file an issue.