cancel
Showing results for 
Search instead for 
Did you mean: 

Accept.js Integration / Attaching an Invoice Number

I'm integrating a simple purchase form with Authorize.net using Accept.js and I would like to have an Invoice # or Job # recorded with the credit card transaction. The form submission handler looks like:

function getSecureData() {

  /* Compile Data from Form */
  var secureData = {},  authData = {},  cardData = {};  cardData.cardNumber = document.getElementById('CARDNUMBER_ID').value;  cardData.month = document.getElementById('EXPIRY_MONTH_ID').value;  cardData.year = document.getElementById('EXPIRY_YEAR_ID').value;  cardData.zip  = document.getElementById('ZIP_CODE').value;  cardData.cardCode  = document.getElementById('CARD_CODE').value;  authData.clientKey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';  authData.apiLoginID = 'XXXXXXXXX';

  /* My attempt to attach a job number to the secureData being submitted */  secureData.userFields = {    job_number: document.getElementById('JOB_NUMBER').value
  };  secureData.cardData = cardData;  secureData.authData = authData;

  /* Dispatch Data to Accept.js */
  Accept.dispatchData(secureData, 'responseHandler');

}

I was trying to extrapolate from the data structure from createTransactionRequest in the documentation. However, the info doesn't seem to make it to the merchant's receipt.

Does anyone have any suggestions or experience doing this?

robbieg
Member
1 REPLY 1

Hello @robbieg

 

You would not include an Invoice or Job # information as part of requesting the nonce, but instead during the createTransaction request.

 

Richard

RichardH
Administrator Administrator
Administrator