<?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 CIM code to retrieve existing payment profiles in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-code-to-retrieve-existing-payment-profiles/m-p/29350#M15422</link>
    <description>&lt;P&gt;I know this is in here somewhere, but I've spent many hours trying to work this out on my own and figured it's time to ask for more help. &amp;nbsp; Using CIM php api, I can save a customer profile, and I can save multiple payment profiles to that customer. I know those go in because I can see them appear in my sandbox customer information manager.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't find the method to retrieve a list of payment profiles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I have to retrieve the ids, then retrieve the profiles one at a time -- but there's probably a better way. One at a time would be awfully slow. &amp;nbsp;But I'm having no luck even retrieving the list of ids.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems like this is supposed to work:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2" face="courier new,courier"&gt;$request = new AuthorizeNetCIM;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="2" face="courier new,courier"&gt; $response = $request-&amp;gt;getCustomerProfile($customerProfileId);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2" face="courier new,courier"&gt;$list = $response-&amp;gt;getCustomerPaymentProfileIds();&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I get the correct customerProfile,&amp;nbsp;but $list is null.&lt;/P&gt;</description>
    <pubDate>Sun, 02 Sep 2012 03:51:04 GMT</pubDate>
    <dc:creator>alanm123</dc:creator>
    <dc:date>2012-09-02T03:51:04Z</dc:date>
    <item>
      <title>CIM code to retrieve existing payment profiles</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-code-to-retrieve-existing-payment-profiles/m-p/29350#M15422</link>
      <description>&lt;P&gt;I know this is in here somewhere, but I've spent many hours trying to work this out on my own and figured it's time to ask for more help. &amp;nbsp; Using CIM php api, I can save a customer profile, and I can save multiple payment profiles to that customer. I know those go in because I can see them appear in my sandbox customer information manager.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't find the method to retrieve a list of payment profiles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I have to retrieve the ids, then retrieve the profiles one at a time -- but there's probably a better way. One at a time would be awfully slow. &amp;nbsp;But I'm having no luck even retrieving the list of ids.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems like this is supposed to work:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2" face="courier new,courier"&gt;$request = new AuthorizeNetCIM;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="2" face="courier new,courier"&gt; $response = $request-&amp;gt;getCustomerProfile($customerProfileId);&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2" face="courier new,courier"&gt;$list = $response-&amp;gt;getCustomerPaymentProfileIds();&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I get the correct customerProfile,&amp;nbsp;but $list is null.&lt;/P&gt;</description>
      <pubDate>Sun, 02 Sep 2012 03:51:04 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-code-to-retrieve-existing-payment-profiles/m-p/29350#M15422</guid>
      <dc:creator>alanm123</dc:creator>
      <dc:date>2012-09-02T03:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: CIM code to retrieve existing payment profiles</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-code-to-retrieve-existing-payment-profiles/m-p/29354#M15424</link>
      <description>&lt;P&gt;This should get you fairly close to where you need to go. Just use print_r() if you're not sure about the data structure at any point.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    $profile = $request-&amp;gt;getCustomerProfile($profile_id);
    
    if (!$profile-&amp;gt;isOk())
        $errors[] = $profile-&amp;gt;xml-&amp;gt;messages-&amp;gt;message-&amp;gt;text;

    else for ($i = 0; $pprofile = $profile-&amp;gt;xml-&amp;gt;profile-&amp;gt;paymentProfiles[$i]; $i++) {
        if ($pprofile-&amp;gt;payment-&amp;gt;bankAccount)
            $display['profiles'][] = array($pprofile-&amp;gt;customerPaymentProfileId, "Bank Account {$pprofile-&amp;gt;payment-&amp;gt;bankAccount-&amp;gt;routingNumber}-{$pprofile-&amp;gt;payment-&amp;gt;bankAccount-&amp;gt;accountNumber}");
        elseif ($pprofile-&amp;gt;payment-&amp;gt;creditCard)
            $display['profiles'][] = array($pprofile-&amp;gt;customerPaymentProfileId, "Credit Card XXXXXXXX{$pprofile-&amp;gt;payment-&amp;gt;creditCard-&amp;gt;cardNumber}");
    }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Sep 2012 05:09:49 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-code-to-retrieve-existing-payment-profiles/m-p/29354#M15424</guid>
      <dc:creator>TJPride</dc:creator>
      <dc:date>2012-09-02T05:09:49Z</dc:date>
    </item>
  </channel>
</rss>

