<?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 SDK issue in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/PHP-SDK-issue/m-p/71166#M43806</link>
    <description>&lt;P&gt;All, I have solved this. For anyone else who may encounter this issue, the "use" code cannot be inside a function, it needs to be available globally.&lt;/P&gt;</description>
    <pubDate>Mon, 23 Mar 2020 17:23:44 GMT</pubDate>
    <dc:creator>idextrus</dc:creator>
    <dc:date>2020-03-23T17:23:44Z</dc:date>
    <item>
      <title>PHP SDK issue</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/PHP-SDK-issue/m-p/71165#M43805</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've got the SDK installed via Composer and here is the path:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/anet_php_sdk/vendor/autoload.php&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm loading it like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;require $_SERVER["DOCUMENT_ROOT"].'/anet_php_sdk/vendor/autoload.php';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are no load errors and I checked by changing "vendor" to "vendors" and it gave an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now I'm trying to set the API credentials as per&amp;nbsp;&lt;A href="https://github.com/AuthorizeNet/sdk-php" target="_blank"&gt;https://github.com/AuthorizeNet/sdk-php&lt;/A&gt;&amp;nbsp;like so:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use net\authorize\api\contract\v1 as AnetAPI;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but when I test the page I get this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Parse error: syntax error, unexpected 'use' (T_USE) in /path/to/file/file.php on line 209&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any thoughts are greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2020 16:52:25 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/PHP-SDK-issue/m-p/71165#M43805</guid>
      <dc:creator>idextrus</dc:creator>
      <dc:date>2020-03-23T16:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: PHP SDK issue</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/PHP-SDK-issue/m-p/71166#M43806</link>
      <description>&lt;P&gt;All, I have solved this. For anyone else who may encounter this issue, the "use" code cannot be inside a function, it needs to be available globally.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Mar 2020 17:23:44 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/PHP-SDK-issue/m-p/71166#M43806</guid>
      <dc:creator>idextrus</dc:creator>
      <dc:date>2020-03-23T17:23:44Z</dc:date>
    </item>
  </channel>
</rss>

