<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do I get response code for CIM PHP SDK? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-do-I-get-response-code-for-CIM-PHP-SDK/m-p/15610#M8877</link>
    <description>&lt;P&gt;I am using the following code&lt;/P&gt;&lt;PRE&gt;$customerProfile = new AuthorizeNetCustomer;
	$customerProfile-&amp;gt;description = "Description of customer";
	$customerProfile-&amp;gt;merchantCustomerId = "honululu27";
	$customerProfile-&amp;gt;email = "user2@domain.com";

	// Add payment profile.
	$paymentProfile = new AuthorizeNetPaymentProfile;
	$paymentProfile-&amp;gt;payment-&amp;gt;creditCard-&amp;gt;cardNumber = "4111111111111111";
	$paymentProfile-&amp;gt;payment-&amp;gt;creditCard-&amp;gt;expirationDate = "2015-10";
	$customerProfile-&amp;gt;paymentProfiles[] = $paymentProfile;
	
	//Check customer
	$request = new AuthorizeNetCIM;
	$response = $request-&amp;gt;createCustomerProfile($customerProfile);
	echo $response-&amp;gt;getCustomerProfileId(); //shows up only in case of success
	echo $response-&amp;gt;xml-&amp;gt;resultCode; //never shows up
        echo $response-&amp;gt;xml-&amp;gt;message-&amp;gt;code; //never shows up
        echo $response-&amp;gt;xml-&amp;gt;customerProfileId; //shows up only in case of success
	
        // Confused about the portion below&lt;BR /&gt;	if($response-&amp;gt;isOk())
	{
		echo "Success";
		echo $response-&amp;gt;getCustomerProfileId();
	}
	else
	{
		echo "FAILED";
		echo $response-&amp;gt;xml-&amp;gt;resultCode;
	}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Now, as you can probably tell, i am a novice at this, so I can't figure out how to display the message text and code. The only thing working is the customer id, which shows up in case of success, but what about all the other xml fields like messages?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Aug 2011 10:38:47 GMT</pubDate>
    <dc:creator>mps_sudipta</dc:creator>
    <dc:date>2011-08-03T10:38:47Z</dc:date>
    <item>
      <title>How do I get response code for CIM PHP SDK?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-do-I-get-response-code-for-CIM-PHP-SDK/m-p/15610#M8877</link>
      <description>&lt;P&gt;I am using the following code&lt;/P&gt;&lt;PRE&gt;$customerProfile = new AuthorizeNetCustomer;
	$customerProfile-&amp;gt;description = "Description of customer";
	$customerProfile-&amp;gt;merchantCustomerId = "honululu27";
	$customerProfile-&amp;gt;email = "user2@domain.com";

	// Add payment profile.
	$paymentProfile = new AuthorizeNetPaymentProfile;
	$paymentProfile-&amp;gt;payment-&amp;gt;creditCard-&amp;gt;cardNumber = "4111111111111111";
	$paymentProfile-&amp;gt;payment-&amp;gt;creditCard-&amp;gt;expirationDate = "2015-10";
	$customerProfile-&amp;gt;paymentProfiles[] = $paymentProfile;
	
	//Check customer
	$request = new AuthorizeNetCIM;
	$response = $request-&amp;gt;createCustomerProfile($customerProfile);
	echo $response-&amp;gt;getCustomerProfileId(); //shows up only in case of success
	echo $response-&amp;gt;xml-&amp;gt;resultCode; //never shows up
        echo $response-&amp;gt;xml-&amp;gt;message-&amp;gt;code; //never shows up
        echo $response-&amp;gt;xml-&amp;gt;customerProfileId; //shows up only in case of success
	
        // Confused about the portion below&lt;BR /&gt;	if($response-&amp;gt;isOk())
	{
		echo "Success";
		echo $response-&amp;gt;getCustomerProfileId();
	}
	else
	{
		echo "FAILED";
		echo $response-&amp;gt;xml-&amp;gt;resultCode;
	}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Now, as you can probably tell, i am a novice at this, so I can't figure out how to display the message text and code. The only thing working is the customer id, which shows up in case of success, but what about all the other xml fields like messages?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2011 10:38:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-do-I-get-response-code-for-CIM-PHP-SDK/m-p/15610#M8877</guid>
      <dc:creator>mps_sudipta</dc:creator>
      <dc:date>2011-08-03T10:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get response code for CIM PHP SDK?</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-do-I-get-response-code-for-CIM-PHP-SDK/m-p/15626#M8884</link>
      <description>&lt;P&gt;If the response is in the same format as for AIM and ARB, you should be able to access the result code with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$response-&amp;gt;xml-&amp;gt;messages-&amp;gt;resultCode&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and descriptive text with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$response-&amp;gt;xml-&amp;gt;messages-&amp;gt;message-&amp;gt;text&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I know it's a bit confusing - I had to experiment a lot before I figured out how to do it. Your best bet is to use print_r() to output the response so you can see what it looks like, then print_r() the individual parts and gradually work your way to the specific variable you want. If you're not familiar with print_r(), go to php.net and search for it.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Aug 2011 12:47:05 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/How-do-I-get-response-code-for-CIM-PHP-SDK/m-p/15626#M8884</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2011-08-03T12:47:05Z</dc:date>
    </item>
  </channel>
</rss>

