<?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 Re: Can't Get getCustomerPaymentProfile() To Work in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15240#M8702</link>
    <description>&lt;P&gt;For instance:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cannot access private property AuthnetCIM::$response ﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is the error I get when I try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;echo $request-&amp;gt;response;&lt;BR /&gt;﻿&lt;/P&gt;&lt;P&gt;I am trying to strip the cc info that's listed between &amp;lt;CardNumber&amp;gt;&amp;lt;/CardNumber&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;That data comes from:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; &lt;STRONG&gt;[response:private]&lt;/STRONG&gt; =&amp;gt; ﻿&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&amp;lt;getCustomerPaymentProfileResponse xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xmlns:xsd="&lt;A href="http://www.w3.org/2001/XMLSchema" target="_blank"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"&amp;gt;&amp;lt;messages&amp;gt;&amp;lt;resultCode&amp;gt;Ok&amp;lt;/resultCode&amp;gt;&amp;lt;message&amp;gt;&amp;lt;code&amp;gt;I00001&amp;lt;/code&amp;gt;&amp;lt;text&amp;gt;Successful.&amp;lt;/text&amp;gt;&amp;lt;/message&amp;gt;&amp;lt;/messages&amp;gt;&amp;lt;paymentProfile&amp;gt;&amp;lt;customerType&amp;gt;individual&amp;lt;/customerType&amp;gt;.....&amp;lt;creditCard&amp;gt;&lt;STRONG&gt;&amp;lt;cardNumber&amp;gt;XXXX0012&amp;lt;/cardNumber&amp;gt;&lt;/STRONG&gt;&amp;lt;expirationDate&amp;gt;XXXX&amp;lt;/expirationDate&amp;gt;&amp;lt;/creditCard&amp;gt;&amp;lt;/payment&amp;gt;&amp;lt;/paymentProfile&amp;gt;&amp;lt;/getCustomerPaymentProfileResponse&amp;gt;&lt;/PRE&gt;&lt;P&gt;How do you guys pull this info out?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2011 17:18:25 GMT</pubDate>
    <dc:creator>jbh1977</dc:creator>
    <dc:date>2011-07-25T17:18:25Z</dc:date>
    <item>
      <title>Can't Get getCustomerPaymentProfile() To Work</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15220#M8692</link>
      <description>&lt;P&gt;EDIT: I realized that by using getCustomerProfile I CAN get the last 4 digits to show of the CC (the point of this post).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With that said, I will leave the question open, though, just as I am curious as to why I am able to get the customer profile data to show but nothing shows properly when I use getCustomerPaymentProfile. So while my issue is technically solved (getting the last 4 digits of their cc info) I am curious to see why one function works and one does not. Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#### Original Post Before Edit ####&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Everything else seems to work fine for me. Yet when I try to pull the payment data, so I can have repeat customers see a reminder of the last CC they used (I just want them to see the last 4 digits, that's all). Creating profiles is a snap for me. Getting the basic address profile data is easy. Getting the payment profile data, not so much. Curious as to what I am doing wrong. Ty&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;require('AuthnetCIM.class.php');&lt;BR /&gt;&lt;BR /&gt;$request = new AuthnetCIM('mylogin', 'my_trans_id', AuthnetCIM::USE_DEVELOPMENT_SERVER);&lt;BR /&gt;&lt;BR /&gt;$profile_id="xxxxxx";&lt;BR /&gt;$payment_profile_id="xxxxxx";&lt;BR /&gt;&lt;BR /&gt;# A guesswork attempt to pull data by passing the payment profile id that I have stored&lt;BR /&gt;&lt;BR /&gt;$request-&amp;gt;setParameter('customerPaymentProfileId', $payment_profile_id);&lt;BR /&gt;&lt;BR /&gt;$request-&amp;gt;getCustomerPaymentProfile();&lt;BR /&gt;&lt;BR /&gt;print_r($request); // just to test out the printout&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;﻿&lt;/PRE&gt;&lt;P&gt;The error I receive is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;customerProfileId' element is invalid - The value '' is invalid according to its datatype 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:numericString' - The Pattern constraint failed.﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Above that I receive this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;E00003&lt;/STRONG&gt;﻿&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As an error as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, what code am I missing to remedy this? Once again, getting shipping or billing data is easy. Getting the payment data, I can't figure it out for some reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2011 15:18:36 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15220#M8692</guid>
      <dc:creator>jbh1977</dc:creator>
      <dc:date>2011-07-25T15:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Get getCustomerPaymentProfile() To Work</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15222#M8693</link>
      <description>&lt;P&gt;Shouldn't it setParameter the profile_id too?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2011 15:36:35 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15222#M8693</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2011-07-25T15:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Get getCustomerPaymentProfile() To Work</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15226#M8695</link>
      <description>&lt;P&gt;I thought so but when I tried it originally I received an error. I must have done something else wrong. Now, when I add this line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$request-&amp;gt;setParameter('customerProfileId', $profile_id);&lt;BR /&gt;﻿&lt;/P&gt;&lt;P&gt;But call&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$request-&amp;gt;getCustomerPaymentProfile();&lt;BR /&gt;﻿&lt;/P&gt;&lt;P&gt;I get no errors and the name, addy and last 4 digits show. Go figure...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2011 16:01:08 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15226#M8695</guid>
      <dc:creator>jbh1977</dc:creator>
      <dc:date>2011-07-25T16:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Get getCustomerPaymentProfile() To Work</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15234#M8699</link>
      <description>&lt;P&gt;One last q - what is the best way to retrieve this value? (the cc 4 digit number)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I saw some code that parses through the xml but it's not working for me. Would any basic xml php function get the job done?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Has anybody had success parsing through it or is there documentation I am not aware of that shows how?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2011 16:29:13 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15234#M8699</guid>
      <dc:creator>jbh1977</dc:creator>
      <dc:date>2011-07-25T16:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Get getCustomerPaymentProfile() To Work</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15240#M8702</link>
      <description>&lt;P&gt;For instance:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cannot access private property AuthnetCIM::$response ﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is the error I get when I try something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;echo $request-&amp;gt;response;&lt;BR /&gt;﻿&lt;/P&gt;&lt;P&gt;I am trying to strip the cc info that's listed between &amp;lt;CardNumber&amp;gt;&amp;lt;/CardNumber&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;That data comes from:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; &lt;STRONG&gt;[response:private]&lt;/STRONG&gt; =&amp;gt; ﻿&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&amp;lt;getCustomerPaymentProfileResponse xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xmlns:xsd="&lt;A href="http://www.w3.org/2001/XMLSchema" target="_blank"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"&amp;gt;&amp;lt;messages&amp;gt;&amp;lt;resultCode&amp;gt;Ok&amp;lt;/resultCode&amp;gt;&amp;lt;message&amp;gt;&amp;lt;code&amp;gt;I00001&amp;lt;/code&amp;gt;&amp;lt;text&amp;gt;Successful.&amp;lt;/text&amp;gt;&amp;lt;/message&amp;gt;&amp;lt;/messages&amp;gt;&amp;lt;paymentProfile&amp;gt;&amp;lt;customerType&amp;gt;individual&amp;lt;/customerType&amp;gt;.....&amp;lt;creditCard&amp;gt;&lt;STRONG&gt;&amp;lt;cardNumber&amp;gt;XXXX0012&amp;lt;/cardNumber&amp;gt;&lt;/STRONG&gt;&amp;lt;expirationDate&amp;gt;XXXX&amp;lt;/expirationDate&amp;gt;&amp;lt;/creditCard&amp;gt;&amp;lt;/payment&amp;gt;&amp;lt;/paymentProfile&amp;gt;&amp;lt;/getCustomerPaymentProfileResponse&amp;gt;&lt;/PRE&gt;&lt;P&gt;How do you guys pull this info out?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2011 17:18:25 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15240#M8702</guid>
      <dc:creator>jbh1977</dc:creator>
      <dc:date>2011-07-25T17:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can't Get getCustomerPaymentProfile() To Work</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15252#M8707</link>
      <description>&lt;P&gt;Got it. I had to use another version of the CIM class to get it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. For reference, for those wondering, here is what I did:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;require('anet_php_sdk/lib/shared/AuthorizeNetXMLResponse.php');


require('anet_php_sdk/lib/shared/AuthorizeNetRequest.php');


require('anet_php_sdk/lib/AuthorizeNetCIM.php');


$request = new AuthorizeNetCIM('login', 'trans_key');

$profile_id="profile_id_of_customer";

$response = $request-&amp;gt; getCustomerProfile($profile_id);

foreach($response-&amp;gt;xml-&amp;gt;profile-&amp;gt;paymentProfiles AS $key =&amp;gt; $paymentid) {
echo "&amp;lt;P&amp;gt;";
	echo $paymentid-&amp;gt;payment-&amp;gt;creditCard-&amp;gt;cardNumber . "&amp;lt;br /&amp;gt;";
echo "&amp;lt;/p&amp;gt;";

}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Not pretty but I just got it to work. Hope this helps somebody. FYI, it returns the CC # as xxxx1111 (1111 = the last 4 digits as they were entered).&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2011 18:43:56 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Can-t-Get-getCustomerPaymentProfile-To-Work/m-p/15252#M8707</guid>
      <dc:creator>jbh1977</dc:creator>
      <dc:date>2011-07-25T18:43:56Z</dc:date>
    </item>
  </channel>
</rss>

