cancel
Showing results for 
Search instead for 
Did you mean: 

CIM createCustomerProfileTransactionRequest and validationMode

I've am using the CIM XML API and I wanted to run some test auth/capture calls.  I can see by the documentation that I should be using createCustomerProfileTransactionRequest.  In my research for other possibilities (AIM) I see that in that process of making your auth/capture calls you can set a validationMode of "testMode", "liveMode" or "none".  What I don't see is this option for the CIM XML createCustomerProfileTransactionRequest. I downloaded and searched the schema for CIM XML and I can see there is no validationMode for createCustomerProfileTransactionRequest.

 

My question is, to perform test calls using createCustomerProfileTransactionRequest must I put my account into "Test Mode" to do this? And yes, I realize that I could also test against a Test Account.

 

 

pberce
Contributor
3 REPLIES 3

The best way to test is to use live mode on a developer (test) account. Test mode on a production account does not come as close to producing the same results as live mode on a production account.

 

Incidently, looking at the PHP library, it appears validationMode is being inserted just before extraOptions. I could be wrong, of course.

TJPride
Expert

TJ,

 

Thanks for the reply.  Where can I find this PHP library?  I've been using John Conde's compliation for my XML needs.  I've looked in the CIM_XML guide PDF, John Conde's GitHub site and I downloaded the anet_php_sdk-1.1.8 and I don't see where the validationMode is being inserted on a createCustomerProfileTransactionRequest.  If I am missing something could you post where you found that?

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.