<?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: Class SampleCode\Constants not found in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/60981#M35488</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's a little late answer, but it can help other users if they visite this post for the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You get this error because your script don't know the "&lt;SPAN&gt;SampleCode" spacename, and the "Constants" class, to extract constants values from it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to solve it you must include this file from Github "&lt;U&gt;&lt;STRONG&gt;&lt;A title="sample-code-php/constants/Constants.php" href="https://github.com/AuthorizeNet/sample-code-php/blob/master/constants/Constants.php" target="_blank"&gt;sample-code-php/constants/Constants.php&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt;", at the very top of your script (&lt;SPAN&gt;charge-credit-card.php for exemple)&lt;/SPAN&gt;, and it will work fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't forget to update informations inside this file, and add your's if you want to use them the same way.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Dec 2017 11:38:29 GMT</pubDate>
    <dc:creator>molmi</dc:creator>
    <dc:date>2017-12-26T11:38:29Z</dc:date>
    <item>
      <title>Class SampleCode\Constants not found</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/55328#M30240</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;I'm trying to test the API running one of the built-in examples but I have an error.&lt;BR /&gt;&lt;BR /&gt;I've downloaded this sdk: &lt;A href="https://github.com/AuthorizeNet/sdk-php/archive/1.8.9.zip" target="_blank"&gt;https://github.com/AuthorizeNet/sdk-php/archive/1.8.9.zip&lt;/A&gt;&lt;BR /&gt;Then I've downloaded this sample code: &lt;A href="https://github.com/AuthorizeNet/sample-code-php" target="_blank"&gt;https://github.com/AuthorizeNet/sample-code-php&lt;/A&gt;&lt;BR /&gt;I've added to the code of the file charge-credit-card.php&amp;nbsp; this line:&lt;BR /&gt;require '/home/ubuntu/testAuthorize/sdk-php/autoload.php';&lt;BR /&gt;&lt;BR /&gt;But when I run the command: "php PaymentTransactions/charge-credit-card.php" I have this error:&lt;BR /&gt;PHP Fatal error:&amp;nbsp; Class 'SampleCode\Constants' not found in /home/ubuntu/testAuthorize/sample-code-php-master/PaymentTransactions/charge-credit-card.php on line 64&lt;BR /&gt;&lt;BR /&gt;which is the problem?&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;&lt;BR /&gt;Claudio&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 12:48:29 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/55328#M30240</guid>
      <dc:creator>ilclaudio</dc:creator>
      <dc:date>2016-08-02T12:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Class SampleCode\Constants not found</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/55329#M30241</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/20387"&gt;@ilclaudio﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After you installed the SDK, did you perform a composer update?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Tue, 02 Aug 2016 17:30:57 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/55329#M30241</guid>
      <dc:creator>RichardH</dc:creator>
      <dc:date>2016-08-02T17:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: Class SampleCode\Constants not found</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/55711#M30554</link>
      <description>&lt;P&gt;I am having the exact same issue, I did a composer update.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[root@voice1 RecurringBilling]# php create-subscription.php&lt;BR /&gt;PHP Fatal error: Uncaught Error: Class 'SampleCode\Constants' not found in /tmp/authorize/authorize-2/sample-code-php-master/RecurringBilling/create-subscription.php:13&lt;BR /&gt;Stack trace:&lt;BR /&gt;#0 /tmp/authorize/authorize-2/sample-code-php-master/RecurringBilling/create-subscription.php(74): createSubscription(23)&lt;BR /&gt;#1 {main}&lt;BR /&gt;thrown in /tmp/authorize/authorize-2/sample-code-php-master/RecurringBilling/create-subscription.php on line 13&lt;BR /&gt;[root@voice1 RecurringBilling]#&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2016 21:15:43 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/55711#M30554</guid>
      <dc:creator>dovi5988</dc:creator>
      <dc:date>2016-09-11T21:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Class SampleCode\Constants not found</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/55733#M30574</link>
      <description>&lt;P&gt;I am having the exact same issue as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Sep 2016 10:52:19 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/55733#M30574</guid>
      <dc:creator>dovi5988</dc:creator>
      <dc:date>2016-09-14T10:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: Class SampleCode\Constants not found</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/55778#M30618</link>
      <description>&lt;P&gt;Looking at the documentation here&amp;nbsp;&lt;A href="http://developer.authorize.net/api/reference/index.html#payment-transactions-charge-a-credit-card" target="_self"&gt;http://developer.authorize.net/api/reference/index.html#payment-transactions-charge-a-credit-card&lt;/A&gt;&amp;nbsp;the only valid response is 'Error' or&amp;nbsp;&lt;SPAN&gt;Ok. I updated the code from:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if($response-&amp;gt;getMessages()-&amp;gt;getResultCode() == \SampleCode\Constants::RESPONSE_OK)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if($response-&amp;gt;getMessages()-&amp;gt;getResultCode() == 'Ok' || $response-&amp;gt;getMessages()-&amp;gt;getResultCode() == 'Error'){&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Sep 2016 14:39:59 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/55778#M30618</guid>
      <dc:creator>dovi5988</dc:creator>
      <dc:date>2016-09-18T14:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Class SampleCode\Constants not found</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/60981#M35488</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's a little late answer, but it can help other users if they visite this post for the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You get this error because your script don't know the "&lt;SPAN&gt;SampleCode" spacename, and the "Constants" class, to extract constants values from it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to solve it you must include this file from Github "&lt;U&gt;&lt;STRONG&gt;&lt;A title="sample-code-php/constants/Constants.php" href="https://github.com/AuthorizeNet/sample-code-php/blob/master/constants/Constants.php" target="_blank"&gt;sample-code-php/constants/Constants.php&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt;", at the very top of your script (&lt;SPAN&gt;charge-credit-card.php for exemple)&lt;/SPAN&gt;, and it will work fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Don't forget to update informations inside this file, and add your's if you want to use them the same way.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Dec 2017 11:38:29 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/60981#M35488</guid>
      <dc:creator>molmi</dc:creator>
      <dc:date>2017-12-26T11:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Class SampleCode\Constants not found</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/62175#M36545</link>
      <description>&lt;P&gt;Confirmed. Had the same problem. Added this at the top:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;require 'constants/Constants.php';&lt;/PRE&gt;&lt;P&gt;Note: I moved the "constants" folder from the&amp;nbsp;sample-code-php folder into the&amp;nbsp;sdk-php folder.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Mar 2018 03:24:13 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Class-SampleCode-Constants-not-found/m-p/62175#M36545</guid>
      <dc:creator>jessekanner</dc:creator>
      <dc:date>2018-03-18T03:24:13Z</dc:date>
    </item>
  </channel>
</rss>

