I'm in need of some help with accept.js. I've created a basic form and included the accept.js library link and have the javascript in place (just like the example shows). When I submit the form, I can see in my console the dataDescriptor and dataValue. Now what do I do with it??? I looked at the sample application on GitHub, but it makes no sense to me.....In my sandbox account, I don't see any unsettled transactions. I'm assuming this is because the dataValue actually holds the transaction information, but I don't know what to do with it...
Any help will be appreciated. Like I said, this is new to me (accepting credit card payments, that is).
12-06-2016 04:37 PM
Hello @atomicimprints
After you have the nonce, you will use createTransactionRequest and use the Nonce for payment data as shown below:
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
<name>yours</name>
<transactionKey>yours</transactionKey>
</merchantAuthentication>
<transactionRequest>
<transactionType>authCaptureTransaction</transactionType>
<amount>75.00</amount>
<payment>
<opaqueData>
<dataDescriptor>COMMON.ACCEPT.INAPP.PAYMENT</dataDescriptor>
<dataValue>nonce_here</dataValue >
</opaqueData>
</payment>
</transactionRequest>
</createTransactionRequest>
12-08-2016 08:03 AM
Hi Richard,
Thanks for that. Do I place the XML in my current PHP page that has my form? Or do I place it in it's own file and call it from the JavaScript function that gets the nonce?
12-08-2016 08:25 AM
Hello @atomicimprints
While it may be possible to do this on a single page, it is more likely that you'll take the results from your call to Accept.js POST them to a separate page that will perform the actual API submission to ANET.
Richard
12-08-2016 07:18 PM