<?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: Unexpected '$opaqueData when using PHP SDK sample code in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unexpected-opaqueData-when-using-PHP-SDK-sample-code/m-p/66287#M39846</link>
    <description>&lt;P&gt;Can anybody tell me what support files are needed when using PHP sample code? Is there a complete sample application that can be copied, so I can see what support files are needed, and where they need to be put?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Thu, 07 Feb 2019 20:32:49 GMT</pubDate>
    <dc:creator>jheymann</dc:creator>
    <dc:date>2019-02-07T20:32:49Z</dc:date>
    <item>
      <title>Unexpected '$opaqueData when using PHP SDK sample code</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unexpected-opaqueData-when-using-PHP-SDK-sample-code/m-p/66276#M39837</link>
      <description>&lt;P&gt;I'm having trouble, and I think it is the way I'm deploying the code. I'm thinking it can't find the SDK or something. Here is the code snippet, which is based on the sample PHP code for doing a payment transaction:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&amp;lt;?php&lt;/P&gt;&lt;P align="left"&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#7f0055"&gt;require &lt;FONT size="2" color="#0000c0"&gt;'./sdk-php/autoload.php'&lt;FONT size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#7f0055"&gt;require_once &lt;FONT size="2" color="#0000c0"&gt;'./credentials.php'&lt;FONT size="2"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#7f0055"&gt;use &lt;U&gt;&lt;FONT size="2"&gt;net\authorize\api\contract\v1 &lt;STRONG&gt;&lt;FONT size="2" color="#7f0055"&gt;as &lt;FONT size="2"&gt;AnetAPI;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;STRONG&gt;&lt;FONT size="2" color="#7f0055"&gt;use &lt;U&gt;&lt;FONT size="2"&gt;net\authorize\api\controller &lt;STRONG&gt;&lt;FONT size="2" color="#7f0055"&gt;as &lt;FONT size="2"&gt;AnetController;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2"&gt;define(&lt;FONT size="2" color="#0000c0"&gt;"AUTHORIZENET_LOG_FILE"&lt;FONT size="2"&gt;, &lt;FONT size="2" color="#0000c0"&gt;"phplog"&lt;FONT size="2"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2" color="#7f0055"&gt;&lt;STRONG&gt;function&lt;FONT size="2"&gt; createAnAcceptPaymentTransaction($amount)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;{&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2" color="#557f5f"&gt;/* Create a merchantAuthenticationType object with authentication details&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;retrieved from the constants file */&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2"&gt;$merchantAuthentication = &lt;STRONG&gt;&lt;FONT size="2" color="#7f0055"&gt;new &lt;U&gt;&lt;FONT size="2"&gt;AnetAPI\MerchantAuthenticationType&lt;FONT size="2"&gt;();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;$merchantAuthentication-&amp;gt;setName(&lt;U&gt;\SampleCodeConstants::MERCHANT_LOGIN_ID);&lt;/U&gt;&lt;/P&gt;&lt;P align="left"&gt;$merchantAuthentication-&amp;gt;setTransactionKey(&lt;U&gt;\SampleCodeConstants::MERCHANT_TRANSACTION_KEY);&lt;/U&gt;&lt;/P&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2" color="#557f5f"&gt;// Set the transaction's refId&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2"&gt;$refId = &lt;FONT size="2" color="#0000c0"&gt;'ref' &lt;FONT size="2"&gt;. time();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2"&gt;$dataDesc = $_POST[&lt;FONT size="2" color="#0000c0"&gt;'dataDescriptor'&lt;FONT size="2"&gt;];&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2"&gt;$dataVal = $_POST[&lt;FONT size="2" color="#0000c0"&gt;'dataValue'&lt;FONT size="2"&gt;];&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2"&gt;$Amount = $_POST[&lt;FONT size="2" color="#0000c0"&gt;'Amount'&lt;FONT size="2"&gt;]&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2" color="#557f5f"&gt;// Create the payment object for a payment nonce&lt;/FONT&gt;&lt;/P&gt;&lt;P align="left"&gt;&lt;FONT size="2"&gt;&lt;U&gt;$opaqueData = &lt;STRONG&gt;&lt;FONT size="2" color="#7f0055"&gt;new &lt;U&gt;&lt;FONT size="2"&gt;AnetAPI\OpaqueDataType&lt;FONT size="2"&gt;();&lt;/FONT&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;$opaqueData-&amp;gt;setDataDescriptor($dataDesc);&lt;/P&gt;&lt;P align="left"&gt;$opaqueData-&amp;gt;setDataValue($dataVal);&lt;/P&gt;&lt;P align="left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P align="left"&gt;　&lt;/P&gt;&lt;P&gt;I get the following error referring to the line above where it creates the $opaqueData object:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Parse error: syntax error, unexpected '$opaqueData' (T_VARIABLE) in &lt;STRONG&gt;.../test_auth_process.php on line &lt;STRONG&gt;24.&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What I have is my code in the root of my website. I've copied the SDK-PHP folder to that same folder, and I reference the Autoload, as instructed. I did rename the top level folder from sdk-php-2.0.0 to just sdk-php, as I'm thinking there might be updates at some point. I've tried it looking just for Require 'sdk-php/autoload.php' and './sdk-php/autoload.php', with the same error.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can anybody spot what I'm doing wrong?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks in advance.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 15:43:41 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unexpected-opaqueData-when-using-PHP-SDK-sample-code/m-p/66276#M39837</guid>
      <dc:creator>jheymann</dc:creator>
      <dc:date>2019-02-06T15:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected '$opaqueData when using PHP SDK sample code</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unexpected-opaqueData-when-using-PHP-SDK-sample-code/m-p/66287#M39846</link>
      <description>&lt;P&gt;Can anybody tell me what support files are needed when using PHP sample code? Is there a complete sample application that can be copied, so I can see what support files are needed, and where they need to be put?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Feb 2019 20:32:49 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unexpected-opaqueData-when-using-PHP-SDK-sample-code/m-p/66287#M39846</guid>
      <dc:creator>jheymann</dc:creator>
      <dc:date>2019-02-07T20:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected '$opaqueData when using PHP SDK sample code</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unexpected-opaqueData-when-using-PHP-SDK-sample-code/m-p/66295#M39854</link>
      <description>Post[‘amount’] needs a semicolon after it. This isn’t an api error it is a straight php syntax error. FYI you are passing the amount as a parameter in the method call and then pulling the amount charged from a post variable inside the function. You’re doing double work. You could save a step and just include the post variable as an argument when you do the method call.</description>
      <pubDate>Thu, 07 Feb 2019 23:50:11 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unexpected-opaqueData-when-using-PHP-SDK-sample-code/m-p/66295#M39854</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-02-07T23:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected '$opaqueData when using PHP SDK sample code</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unexpected-opaqueData-when-using-PHP-SDK-sample-code/m-p/66296#M39855</link>
      <description>Your include/require paths are correct, otherwise you would get an error for that as well. Renaming the folder for the sdk will have no effect on anything as long as you rename the include/require path as well. What you never do is rename the files or sub folders in the api sub folder within the sdk package.</description>
      <pubDate>Thu, 07 Feb 2019 23:55:31 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Unexpected-opaqueData-when-using-PHP-SDK-sample-code/m-p/66296#M39855</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-02-07T23:55:31Z</dc:date>
    </item>
  </channel>
</rss>

