Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Member
Posts: 3
Registered: ‎12-02-2016

Accept.js help. Newbie questions...

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).

Posts: 2,765
Topics: 57
Kudos: 272
Blog Posts: 67
Registered: ‎12-05-2011

Re: Accept.js help. Newbie questions...

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>
Member
Posts: 3
Registered: ‎12-02-2016

Re: Accept.js help. Newbie questions...

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?

Posts: 2,765
Topics: 57
Kudos: 272
Blog Posts: 67
Registered: ‎12-05-2011

Re: Accept.js help. Newbie questions...

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