<?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: accept.js - SO CLOSE! One small thing and it will work ... $dataValue ?? in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68161#M41417</link>
    <description>And using double quotes isn’t necessary and may be what’s causing your issue.</description>
    <pubDate>Tue, 25 Jun 2019 19:36:28 GMT</pubDate>
    <dc:creator>Renaissance</dc:creator>
    <dc:date>2019-06-25T19:36:28Z</dc:date>
    <item>
      <title>accept.js - SO CLOSE! One small thing and it will work ... $dataValue ??</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68145#M41402</link>
      <description>&lt;P&gt;Using code from github, I've finally gotten (mostly) accept.js to work, except for ONE thing ...&lt;BR /&gt;&lt;BR /&gt;If I get the value from the returned nonce and paste it into the block below, the transaction will clear. So, I know that everything up to this point is correct:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;    $opaqueData = new AnetAPI\OpaqueDataType();
    $opaqueData-&amp;gt;setDataDescriptor("COMMON.ACCEPT.INAPP.PAYMENT");
    $opaqueData-&amp;gt;setDataValue("eyJjb2RlIjoiNTBfMl8wNjAwMDUyNkE5QzdDRUE2Q0E3QUFBMDAyQTkyMjc1OUEyNEFDMDM0NUJFNEUzOUM0RjYwQjlDMzBFMkJBN0U4NjA4QzE1QzQ5OUVBN0FGMDE2NTJBRjYzMkU1REQ2RUI5NkFEREVDIiwidG9rZW4iOiI5NTYxNDcxMDQyMTc4NjQxMDAzNTAxIiwidiI6IjEuMSJ9");&lt;/PRE&gt;&lt;FONT face="&amp;quot;ScalaSansWeb&amp;quot;,sans-serif"&gt;&lt;BR /&gt;BUT, I need to get that into the block as a variable. Nothing seems to work at the moment.&lt;BR /&gt;Checking to see if I've got a variable assigned.&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;echo 'dataValue '.$dataValue;&lt;/PRE&gt;&lt;FONT face="&amp;quot;ScalaSansWeb&amp;quot;,sans-serif"&gt;This correctly displays the returned value (&amp;nbsp;&lt;FONT face="&amp;quot;ScalaSansWeb&amp;quot;,sans-serif"&gt;eyJjb2RlIjoiNTBfMl8wNjAwMDUyNkE5QzdDRUE2Q0E3QUFBMDAyQTkyMjc1OUEyNEFDMDM0NUJFNEUzOUM0RjYwQjlDMzBFMkJBN0U4NjA4QzE1QzQ5OUVBN0FGMDE2NTJBRjYzMkU1REQ2RUI5NkFEREVDIiwidG9rZW4iOiI5NTYxNDcxMDQyMTc4NjQxMDAzNTAxIiwidiI6IjEuMSJ9&lt;/FONT&gt; ) so it seems my variable is set.&lt;BR /&gt;So back to my code block - trying this:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;    $opaqueData = new AnetAPI\OpaqueDataType();

    $opaqueData-&amp;gt;setDataDescriptor("COMMON.ACCEPT.INAPP.PAYMENT");

    $opaqueData-&amp;gt;setDataValue($dataValue);&lt;/PRE&gt;&lt;FONT face="&amp;quot;ScalaSansWeb&amp;quot;,sans-serif"&gt;This generates an error:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Notice&lt;/STRONG&gt;&lt;SPAN&gt;: Undefined variable: dataValue in &lt;/SPAN&gt;&lt;STRONG&gt;/order_receipt.php&lt;/STRONG&gt;&lt;SPAN&gt; on line &lt;/SPAN&gt;&lt;STRONG&gt;109&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Transaction Failed Error Code : E00003 Error Message : The element 'opaqueData' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'dataValue' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.&lt;BR /&gt;&lt;BR /&gt;Hmmm - right above is my display block, and it's still outputting the correct value.&lt;BR /&gt;&lt;BR /&gt;Just to be SURE I'm not an idiot (and I can be) ... single or double quotes don't work either&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt; $opaqueData-&amp;gt;setDataValue("$dataValue");&lt;/PRE&gt;&lt;FONT face="&amp;quot;ScalaSansWeb&amp;quot;,sans-serif"&gt;&lt;SPAN&gt;&lt;STRONG&gt;Notice&lt;/STRONG&gt;: Undefined variable: dataValue in &lt;STRONG&gt;/order_receipt.php&lt;/STRONG&gt; on line &lt;STRONG&gt;109&lt;/STRONG&gt;&lt;BR /&gt;Transaction Failed Error Code : E00076 Error Message : dataValue contains invalid value.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="&amp;quot;ScalaSansWeb&amp;quot;,sans-serif"&gt;&lt;SPAN&gt;What have I got wrong? I'm an idiot, yes?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 25 Jun 2019 14:16:47 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68145#M41402</guid>
      <dc:creator>LGMizzell</dc:creator>
      <dc:date>2019-06-25T14:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: accept.js - SO CLOSE! One small thing and it will work ... $dataValue ??</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68146#M41403</link>
      <description>&lt;P&gt;Actually, trying to get ANY variables into the code generates the same problem.&lt;BR /&gt;For example, I have $firstNAME and $lastNAME set ...&lt;BR /&gt;&lt;BR /&gt;If the names are hard coded in, it works&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;    $customerAddress-&amp;gt;setFirstName("Bob");

    $customerAddress-&amp;gt;setLastName("Jones");&lt;/PRE&gt;&lt;P&gt;But, trying to get that to work using the variables - ain't working ....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    $customerAddress-&amp;gt;setFirstName($firstNAME);

    $customerAddress-&amp;gt;setLastName($lastNAME);&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jun 2019 14:39:58 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68146#M41403</guid>
      <dc:creator>LGMizzell</dc:creator>
      <dc:date>2019-06-25T14:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: accept.js - SO CLOSE! One small thing and it will work ... $dataValue ??</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68150#M41406</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/31072"&gt;@LGMizzell&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This sounds like a scope issue.&amp;nbsp; If so, there are several ways around it. The first, which will work but is bad practice is to use the global keyword for all the variables you want to use inside that function. So inside the function before you assign those object properties type-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;global $firstName, $lastName;

//comma separate as many variables as you need. &lt;/PRE&gt;&lt;P&gt;Since you have a small project this would probably be fine. Using global variables excessively in larger projects will cause bugs that are very difficult to track down. I still advise against it.&amp;nbsp; Another way is to pass all of those variables as parameters in your function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;function createAnAcceptPaymentTransaction($amount, $firstName, $lastName)

//use the above when defining the function then call it as in the below. You will 
// add the rest of your variables as needed



if (!defined('DONT_RUN_SAMPLES')) {
      createAnAcceptPaymentTransaction($amount,$firstName,$lastName);
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jun 2019 15:26:58 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68150#M41406</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-06-25T15:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: accept.js - SO CLOSE! One small thing and it will work ... $dataValue ??</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68157#M41413</link>
      <description>&lt;P&gt;Regardless of what I try, I can't get it to include the $dataValue from the nonce&lt;BR /&gt;&lt;BR /&gt;$opaqueData-&amp;gt;setDataValue(" WHAT THE HECK DO I PUT RIGHT HERE TO INCLUDE THE VALUE HELD IN THE VARIABLE $dataValue ?");&lt;BR /&gt;&lt;BR /&gt;Adding $dataValue to the globel doesn't help ....&lt;BR /&gt;&lt;BR /&gt;I'm experimenting with it, but no go so far ...&lt;BR /&gt;Also, is there a list of the returned data somewhere? Damned authorize.net docs are convoluted ...&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 18:17:08 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68157#M41413</guid>
      <dc:creator>LGMizzell</dc:creator>
      <dc:date>2019-06-25T18:17:08Z</dc:date>
    </item>
    <item>
      <title>Re: accept.js - SO CLOSE! One small thing and it will work ... $dataValue ??</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68158#M41414</link>
      <description>&lt;P&gt;Also, THIS works and when the receipt comes back, is shown as the correct invoice number:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$order-&amp;gt;setInvoiceNumber("$enrID");&lt;/PRE&gt;&lt;P&gt;So why doesn't it work for the names? Or $dataValue??&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;    $customerAddress-&amp;gt;setFirstName("$fNAME");
    $customerAddress-&amp;gt;setLastName("$lNAME");&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 18:19:33 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68158#M41414</guid>
      <dc:creator>LGMizzell</dc:creator>
      <dc:date>2019-06-25T18:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: accept.js - SO CLOSE! One small thing and it will work ... $dataValue ??</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68159#M41415</link>
      <description>&lt;P&gt;This works too:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;$order-&amp;gt;setDescription("Enrollment Payment $enrID");&lt;/PRE&gt;&lt;P&gt;... and in the receipt email:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;========= ORDER INFORMATION =========
Invoice : 1804875
Description : Enrollment Payment 1804875
Amount : 2.23 (USD)
Payment Method: Visa xxxx1111
Transaction Type: Authorization and Capture&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2019 19:18:24 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68159#M41415</guid>
      <dc:creator>LGMizzell</dc:creator>
      <dc:date>2019-06-25T19:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: accept.js - SO CLOSE! One small thing and it will work ... $dataValue ??</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68160#M41416</link>
      <description>Post your entire script</description>
      <pubDate>Tue, 25 Jun 2019 19:34:43 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68160#M41416</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-06-25T19:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: accept.js - SO CLOSE! One small thing and it will work ... $dataValue ??</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68161#M41417</link>
      <description>And using double quotes isn’t necessary and may be what’s causing your issue.</description>
      <pubDate>Tue, 25 Jun 2019 19:36:28 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68161#M41417</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-06-25T19:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: accept.js - SO CLOSE! One small thing and it will work ... $dataValue ??</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68162#M41418</link>
      <description>Also,&lt;BR /&gt;&lt;BR /&gt;The nonce is a client side output and you and putting it through the server side. How are you assigning the value to the $dataValue variable? Are you posting it with a form? I’m on a phone waiting for my car to get inspected. I may be missing details.</description>
      <pubDate>Tue, 25 Jun 2019 19:40:03 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/68162#M41418</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-06-25T19:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: accept.js - SO CLOSE! One small thing and it will work ... $dataValue ??</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/78726#M49476</link>
      <description>&lt;P&gt;Sounds like you are requesting a hosted pay web page where clients can sign in and store their card statistics, generating a relaxed token link, which you could then use for destiny variable expenses. That itself is quite simple.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 18:10:18 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/accept-js-SO-CLOSE-One-small-thing-and-it-will-work-dataValue/m-p/78726#M49476</guid>
      <dc:creator>hsdf444</dc:creator>
      <dc:date>2022-09-10T18:10:18Z</dc:date>
    </item>
  </channel>
</rss>

