<?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: PHP API: try/catch for connections in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/PHP-API-try-catch-for-connections/m-p/56394#M31190</link>
    <description>&lt;P&gt;Hi Don,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's a fine place for it. You could always go further into the code and modify the "executeWithApiResponse" method or one of its parents to do that kind of error checking at a lower level. I wouldn't. Better&amp;nbsp;instead to keep those additions in your code instead of modifying the SDK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just know that if you do catch an exception from that statement, the code will proceed but the "$response" variable will be undefined, so that will cause a couple of more errors to be output. You can either try to trap those or just not worry about them since you've already caught the exception leading to those errors.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Dec 2016 23:22:59 GMT</pubDate>
    <dc:creator>Aaron</dc:creator>
    <dc:date>2016-12-09T23:22:59Z</dc:date>
    <item>
      <title>PHP API: try/catch for connections</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/PHP-API-try-catch-for-connections/m-p/56384#M31180</link>
      <description>&lt;P&gt;I'm using the PHP API and I'd like to put a try/catch to see if we are not connecting to Authorize.net and I'm not sure of the best place to put it in the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I put it around this execute?&lt;/P&gt;&lt;P&gt;$response = $controller-&amp;gt;executeWithApiResponse($configHandle-&amp;gt;getUrl());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 19:06:13 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/PHP-API-try-catch-for-connections/m-p/56384#M31180</guid>
      <dc:creator>fifty-git</dc:creator>
      <dc:date>2016-12-09T19:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: PHP API: try/catch for connections</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/PHP-API-try-catch-for-connections/m-p/56394#M31190</link>
      <description>&lt;P&gt;Hi Don,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's a fine place for it. You could always go further into the code and modify the "executeWithApiResponse" method or one of its parents to do that kind of error checking at a lower level. I wouldn't. Better&amp;nbsp;instead to keep those additions in your code instead of modifying the SDK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just know that if you do catch an exception from that statement, the code will proceed but the "$response" variable will be undefined, so that will cause a couple of more errors to be output. You can either try to trap those or just not worry about them since you've already caught the exception leading to those errors.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Dec 2016 23:22:59 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/PHP-API-try-catch-for-connections/m-p/56394#M31190</guid>
      <dc:creator>Aaron</dc:creator>
      <dc:date>2016-12-09T23:22:59Z</dc:date>
    </item>
  </channel>
</rss>

