<?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: Retrieve PaymentProfile after user puts info in through CIM Hosted Form. in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Retrieve-PaymentProfile-after-user-puts-info-in-through-CIM/m-p/49888#M25416</link>
    <description>&lt;P&gt;Me again! (Again...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solved the issue. Posting here for future reference of others. :)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it turns out, the Hosted Profile generates a payment/shipping profile when that information is typed in. This is expected. To retrieve that data, you must make a call&amp;nbsp;to the getCustomerProfileRequest endpoint, and the payment/shipping profile is deep in there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once again, using HTTParty gem.&lt;/P&gt;&lt;PRE&gt;    xml = "&amp;lt;?xml version='1.0' encoding='utf-8'?&amp;gt;
      &amp;lt;getCustomerProfileRequest xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'&amp;gt;
      &amp;lt;merchantAuthentication&amp;gt;
      &amp;lt;name&amp;gt;#{API_LOGIN}&amp;lt;/name&amp;gt;
      &amp;lt;transactionKey&amp;gt;#{TRANSACTION_KEY}&amp;lt;/transactionKey&amp;gt;
      &amp;lt;/merchantAuthentication&amp;gt;
      &amp;lt;customerProfileId&amp;gt;#{self.auth_net_id}&amp;lt;/customerProfileId&amp;gt;
      &amp;lt;/getCustomerProfileRequest&amp;gt;
    "

    uri = URI('https://apitest.authorize.net/xml/v1/request.api')
    req = Net::HTTP::Post.new(uri.path)
    res = HTTParty.post(uri, body: xml, headers: { 'Content-Type' =&amp;gt; 'application/xml' })

    payment_id = Hash.from_xml(res.body)["getCustomerProfileResponse"]["profile"]["paymentProfiles"]["customerPaymentProfileId"]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2015 01:37:34 GMT</pubDate>
    <dc:creator>Rockster160</dc:creator>
    <dc:date>2015-03-05T01:37:34Z</dc:date>
    <item>
      <title>Retrieve PaymentProfile after user puts info in through CIM Hosted Form.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Retrieve-PaymentProfile-after-user-puts-info-in-through-CIM/m-p/49886#M25414</link>
      <description>&lt;P&gt;Me again- I'm having a lot of trouble integrating this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the goal:&lt;/P&gt;&lt;P&gt;User signs up on the website. Fast and easy, all that is required is their email and a password.&lt;/P&gt;&lt;P&gt;* This then also creates a Customer Profile at Authorize.Net, of which the ID is saved by our site.&lt;/P&gt;&lt;P&gt;The user can browse the site and check things out. However, the user cannot make any purchases until they put in their credit card info. (Obviously.)&lt;/P&gt;&lt;P&gt;The user goes to their Account Edit page, which generates a Hosted Page Token and a redirect button to Authorize.Net's hosted page. They follow the link and they can input their card info which is then saved by Authorize.Net.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Awesome. Everything works great up until that point. However, to create a transaction/charge to their account, I need the PaymentProfileID which should be created when they put their credit card info in. Since our site is not handling any of the users sensitive information at all, I don't have access to those things.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question is how can I get the PaymentProfileID from the Hosted Page after a user has put in their information?&lt;/P&gt;&lt;P&gt;(Btw, I'm using XML and Ruby on Rails)&lt;/P&gt;</description>
      <pubDate>Wed, 04 Mar 2015 22:45:13 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Retrieve-PaymentProfile-after-user-puts-info-in-through-CIM/m-p/49886#M25414</guid>
      <dc:creator>Rockster160</dc:creator>
      <dc:date>2015-03-04T22:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve PaymentProfile after user puts info in through CIM Hosted Form.</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Retrieve-PaymentProfile-after-user-puts-info-in-through-CIM/m-p/49888#M25416</link>
      <description>&lt;P&gt;Me again! (Again...)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solved the issue. Posting here for future reference of others. :)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it turns out, the Hosted Profile generates a payment/shipping profile when that information is typed in. This is expected. To retrieve that data, you must make a call&amp;nbsp;to the getCustomerProfileRequest endpoint, and the payment/shipping profile is deep in there.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once again, using HTTParty gem.&lt;/P&gt;&lt;PRE&gt;    xml = "&amp;lt;?xml version='1.0' encoding='utf-8'?&amp;gt;
      &amp;lt;getCustomerProfileRequest xmlns='AnetApi/xml/v1/schema/AnetApiSchema.xsd'&amp;gt;
      &amp;lt;merchantAuthentication&amp;gt;
      &amp;lt;name&amp;gt;#{API_LOGIN}&amp;lt;/name&amp;gt;
      &amp;lt;transactionKey&amp;gt;#{TRANSACTION_KEY}&amp;lt;/transactionKey&amp;gt;
      &amp;lt;/merchantAuthentication&amp;gt;
      &amp;lt;customerProfileId&amp;gt;#{self.auth_net_id}&amp;lt;/customerProfileId&amp;gt;
      &amp;lt;/getCustomerProfileRequest&amp;gt;
    "

    uri = URI('https://apitest.authorize.net/xml/v1/request.api')
    req = Net::HTTP::Post.new(uri.path)
    res = HTTParty.post(uri, body: xml, headers: { 'Content-Type' =&amp;gt; 'application/xml' })

    payment_id = Hash.from_xml(res.body)["getCustomerProfileResponse"]["profile"]["paymentProfiles"]["customerPaymentProfileId"]&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2015 01:37:34 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Retrieve-PaymentProfile-after-user-puts-info-in-through-CIM/m-p/49888#M25416</guid>
      <dc:creator>Rockster160</dc:creator>
      <dc:date>2015-03-05T01:37:34Z</dc:date>
    </item>
  </channel>
</rss>

