<?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: Capture Customer Information using PHP in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Capture-Customer-Information-using-PHP/m-p/56326#M31126</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20955"&gt;@aaron0045&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sending other information is very similar to the way you're sending the card information. In addition to&amp;nbsp;making a new&amp;nbsp;CreditCardType(), you'd make an instance&amp;nbsp;of one of the other classes, like CustomerDataType(), NameAndAddressType(), or CustomerAddressType(). If you want to see where all of these classes are defined, you can dig into the PHP SDK in vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your case, you'd do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// Customer info 
$customer = new AnetAPI\CustomerDataType();
$customer-&amp;gt;setEmail("foo@example.com");

// Bill To
$billto = new AnetAPI\CustomerAddressType();
$billto-&amp;gt;setFirstName("Ellen");
$billto-&amp;gt;setLastName("Johnson");
$billto-&amp;gt;setCompany("Souveniropolis");
$billto-&amp;gt;setAddress("14 Main Street");
$billto-&amp;gt;setCity("Pecan Springs");
$billto-&amp;gt;setState("TX");
$billto-&amp;gt;setZip("44628");
$billto-&amp;gt;setCountry("USA");&lt;/PRE&gt;&lt;P&gt;Then, add the following two lines to where you're building your $transactionRequestType object:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  $transactionRequestType-&amp;gt;setCustomer($customer);
  $transactionRequestType-&amp;gt;setBillTo($billto);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Dec 2016 18:31:13 GMT</pubDate>
    <dc:creator>Aaron</dc:creator>
    <dc:date>2016-12-05T18:31:13Z</dc:date>
    <item>
      <title>Capture Customer Information using PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Capture-Customer-Information-using-PHP/m-p/56314#M31114</link>
      <description>&lt;P&gt;How do I capture other fields like "last name", "first name", and "email" so that they show up in the transaction details? &amp;nbsp;I am using php. &amp;nbsp;My form correctly passes the credit card number, expiration date, and amount. &amp;nbsp;What code can I use to pass other fields?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's&amp;nbsp;mycode that is correctly passing the credit card information:&lt;/P&gt;&lt;PRE&gt;$creditCard = new AnetAPI\CreditCardType();
$creditCard-&amp;gt;setCardNumber($credit_card); 
$creditCard-&amp;gt;setExpirationDate($_POST['expmonth'] . "-" . $_POST['expyear']);
$creditCard-&amp;gt;setCardCode($_POST['securitycode']);&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Dec 2016 21:51:30 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Capture-Customer-Information-using-PHP/m-p/56314#M31114</guid>
      <dc:creator>aaron0045</dc:creator>
      <dc:date>2016-12-02T21:51:30Z</dc:date>
    </item>
    <item>
      <title>Re: Capture Customer Information using PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Capture-Customer-Information-using-PHP/m-p/56326#M31126</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20955"&gt;@aaron0045&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sending other information is very similar to the way you're sending the card information. In addition to&amp;nbsp;making a new&amp;nbsp;CreditCardType(), you'd make an instance&amp;nbsp;of one of the other classes, like CustomerDataType(), NameAndAddressType(), or CustomerAddressType(). If you want to see where all of these classes are defined, you can dig into the PHP SDK in vendor/authorizenet/authorizenet/lib/net/authorize/api/contract/v1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In your case, you'd do something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// Customer info 
$customer = new AnetAPI\CustomerDataType();
$customer-&amp;gt;setEmail("foo@example.com");

// Bill To
$billto = new AnetAPI\CustomerAddressType();
$billto-&amp;gt;setFirstName("Ellen");
$billto-&amp;gt;setLastName("Johnson");
$billto-&amp;gt;setCompany("Souveniropolis");
$billto-&amp;gt;setAddress("14 Main Street");
$billto-&amp;gt;setCity("Pecan Springs");
$billto-&amp;gt;setState("TX");
$billto-&amp;gt;setZip("44628");
$billto-&amp;gt;setCountry("USA");&lt;/PRE&gt;&lt;P&gt;Then, add the following two lines to where you're building your $transactionRequestType object:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  $transactionRequestType-&amp;gt;setCustomer($customer);
  $transactionRequestType-&amp;gt;setBillTo($billto);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2016 18:31:13 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Capture-Customer-Information-using-PHP/m-p/56326#M31126</guid>
      <dc:creator>Aaron</dc:creator>
      <dc:date>2016-12-05T18:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Capture Customer Information using PHP</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Capture-Customer-Information-using-PHP/m-p/58251#M32916</link>
      <description>&lt;P&gt;Thanks for this!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was very confusing at first because the CustomerAddressType provides a setEmail() method, but it doesn't seem to have any effect.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 21:41:30 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Capture-Customer-Information-using-PHP/m-p/58251#M32916</guid>
      <dc:creator>rdosser</dc:creator>
      <dc:date>2017-05-26T21:41:30Z</dc:date>
    </item>
  </channel>
</rss>

