<?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: Trouble Integrating API in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52570#M27803</link>
    <description>&lt;P&gt;Hey Richard,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I'm not actually getting a response from the gateway. The code seems to be breaking at the $controller variable. It's almost like it can't find CreateCustomerProfileController. Could I have installed the SDK incorrectly? Or do you have any other ideas?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Oct 2015 16:18:05 GMT</pubDate>
    <dc:creator>NewToThis</dc:creator>
    <dc:date>2015-10-14T16:18:05Z</dc:date>
    <item>
      <title>Trouble Integrating API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52564#M27798</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am having trouble testing the API. Whenever I try the test codes, I don't get any errors, but instead it seems that I am having issues with this line of code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$controller = new AnetController\CreateTransactionController($request);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the whole piece of code below, but it is just a copy of the Create Customer Profile sample code. I have tried using my sandbox API Login ID and Transaction Key as well. Any advice would be greatly appreciated!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;require 'vendor/autoload.php';&lt;BR /&gt;use net\authorize\api\contract\v1 as AnetAPI;&lt;BR /&gt;use net\authorize\api\controller as AnetController;&lt;BR /&gt;define("AUTHORIZENET_LOG_FILE", "phplog");&lt;BR /&gt;// Common setup for API credentials&lt;BR /&gt;$merchantAuthentication = new AnetAPI\MerchantAuthenticationType();&lt;BR /&gt;$merchantAuthentication-&amp;gt;setName("556KThWQ6vf2");&lt;BR /&gt;$merchantAuthentication-&amp;gt;setTransactionKey("***");&lt;BR /&gt;$refId = 'ref' . time();&lt;/P&gt;
&lt;P&gt;// Create the payment data for a credit card&lt;BR /&gt;$creditCard = new AnetAPI\CreditCardType();&lt;BR /&gt;$creditCard-&amp;gt;setCardNumber( "4111111111111111" );&lt;BR /&gt;$creditCard-&amp;gt;setExpirationDate( "2038-12");&lt;BR /&gt;$paymentCreditCard = new AnetAPI\PaymentType();&lt;BR /&gt;$paymentCreditCard-&amp;gt;setCreditCard($creditCard);&lt;/P&gt;
&lt;P&gt;// Create the Bill To info&lt;BR /&gt;$billto = new AnetAPI\CustomerAddressType();&lt;BR /&gt;$billto-&amp;gt;setFirstName("Ellen");&lt;BR /&gt;$billto-&amp;gt;setLastName("Johnson");&lt;BR /&gt;$billto-&amp;gt;setCompany("Souveniropolis");&lt;BR /&gt;$billto-&amp;gt;setAddress("14 Main Street");&lt;BR /&gt;$billto-&amp;gt;setCity("Pecan Springs");&lt;BR /&gt;$billto-&amp;gt;setState("TX");&lt;BR /&gt;$billto-&amp;gt;setZip("44628");&lt;BR /&gt;$billto-&amp;gt;setCountry("USA");&lt;BR /&gt;&lt;BR /&gt;// Create a Customer Profile Request&lt;BR /&gt;// 1. create a Payment Profile&lt;BR /&gt;// 2. create a Customer Profile&lt;BR /&gt;// 3. Submit a CreateCustomerProfile Request&lt;BR /&gt;// 4. Validate Profiiel ID returned&lt;/P&gt;
&lt;P&gt;$paymentprofile = new AnetAPI\CustomerPaymentProfileType();&lt;/P&gt;
&lt;P&gt;$paymentprofile-&amp;gt;setCustomerType('individual');&lt;BR /&gt;$paymentprofile-&amp;gt;setBillTo($billto);&lt;BR /&gt;$paymentprofile-&amp;gt;setPayment($paymentCreditCard);&lt;BR /&gt;$paymentprofiles[] = $paymentprofile;&lt;BR /&gt;$customerprofile = new AnetAPI\CustomerProfileType();&lt;BR /&gt;$customerprofile-&amp;gt;setDescription("Customer 2 Test PHP");&lt;BR /&gt;$merchantCustomerId = time().rand(1,150);&lt;BR /&gt;$customerprofile-&amp;gt;setMerchantCustomerId($merchantCustomerId);&lt;BR /&gt;$customerprofile-&amp;gt;setEmail("test2@domain.com");&lt;BR /&gt;$customerprofile-&amp;gt;setPaymentProfiles($paymentprofiles);&lt;/P&gt;
&lt;P&gt;$request = new AnetAPI\CreateCustomerProfileRequest();&lt;BR /&gt;$request-&amp;gt;setMerchantAuthentication($merchantAuthentication);&lt;BR /&gt;$request-&amp;gt;setRefId( $refId);&lt;BR /&gt;$request-&amp;gt;setProfile($customerprofile);&lt;BR /&gt;$controller = new AnetController\CreateCustomerProfileController($request);&lt;BR /&gt;$response = $controller-&amp;gt;executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX);&lt;BR /&gt;if (($response != null) &amp;amp;&amp;amp; ($response-&amp;gt;getMessages()-&amp;gt;getResultCode() == "Ok") )&lt;BR /&gt;{&lt;BR /&gt;echo "SUCCESS: PROFILE ID : " . $response-&amp;gt;getCustomerProfileId() . "\n";&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;echo "ERROR : Invalid response\n";&lt;BR /&gt;echo "Response : " . $response-&amp;gt;getMessages()-&amp;gt;getMessage()[0]-&amp;gt;getCode() . " " .$response-&amp;gt;getMessages()-&amp;gt;getMessage()[0]-&amp;gt;getText() . "\n";&lt;BR /&gt;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 15:42:40 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52564#M27798</guid>
      <dc:creator>NewToThis</dc:creator>
      <dc:date>2015-10-14T15:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Integrating API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52569#M27802</link>
      <description>&lt;P&gt;When you submit the transaction, what response is returned by the gateway?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 15:40:02 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52569#M27802</guid>
      <dc:creator>RichardH</dc:creator>
      <dc:date>2015-10-14T15:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Integrating API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52570#M27803</link>
      <description>&lt;P&gt;Hey Richard,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I'm not actually getting a response from the gateway. The code seems to be breaking at the $controller variable. It's almost like it can't find CreateCustomerProfileController. Could I have installed the SDK incorrectly? Or do you have any other ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 16:18:05 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52570#M27803</guid>
      <dc:creator>NewToThis</dc:creator>
      <dc:date>2015-10-14T16:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Integrating API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52571#M27804</link>
      <description>&lt;P&gt;When you look at your connection logs, do you see that you were able to successfully connect to the gateway?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 16:24:50 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52571#M27804</guid>
      <dc:creator>RichardH</dc:creator>
      <dc:date>2015-10-14T16:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Integrating API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52574#M27807</link>
      <description>&lt;P&gt;I'm not sure&amp;nbsp;exactly how to check this, but I don't think it is connecting.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2015 16:57:55 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52574#M27807</guid>
      <dc:creator>NewToThis</dc:creator>
      <dc:date>2015-10-14T16:57:55Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Integrating API</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52637#M27866</link>
      <description>&lt;P&gt;So I figured out the problem. I was having issues with the SerializerBuilder due to using the wrong composer.json file during the installation of the SDK. If anyone else has this issue, the solution can be found here: &lt;A href="https://community.developer.authorize.net/t5/Integration-and-Testing/Basic-Installation-Problem/m-p/52388/highlight/true#M27642" target="_self"&gt;https://community.developer.authorize.net/t5/Integration-and-Testing/Basic-Installation-Problem/m-p/52388/highlight/true#M27642&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 22:41:57 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Trouble-Integrating-API/m-p/52637#M27866</guid>
      <dc:creator>NewToThis</dc:creator>
      <dc:date>2015-10-16T22:41:57Z</dc:date>
    </item>
  </channel>
</rss>

