I would like to bump this quesiton.
I also have no idea what "https://YourServer/PathToExistingPaymentProcessingScript" is supposed to mean or how it is intended to be used. I also keep having issues with authentication:
{code: "E_WC_21", text: "User authentication failed due to invalid authentication values."}
Here is the form:
<form
id="paymentForm"
method="POST"
action="https://YourServer/PathToExistingPaymentProcessingScript"
//"https://api.authorize.net/xml/v1/request.api"
>
<input type="text" name="cardNumber" id="cardNumber" placeholder="cardNumber" />
<input type="text" name="expMonth" id="expMonth" placeholder="expMonth" />
<input type="text" name="expYear" id="expYear" placeholder="expYear" />
<input type="text" name="cardCode" id="cardCode" placeholder="cardCode" />
<input type="hidden" name="dataValue" id="dataValue" />
<input type="hidden" name="dataDescriptor" id="dataDescriptor" />
<button type="button" onClick={this.sendPaymentDataToANet}>
Pay
</button>
</form>
Here is the button's submit method:
sendPaymentDataToANet = () => {
var authData = {};
authData.clientKey = process.env.REACT_APP_AUTHORIZE_NET_TRANSACTION_KEY;
// authData.clientKey = process.env.REACT_APP_AUTHORIZE_NET_PUBLIC_CLIENT_KEY;
authData.apiLoginID = process.env.REACT_APP_AUTHORIZE_NET_API_LOGIN_ID;
var cardData = {};
cardData.cardNumber = document.getElementById('cardNumber').value;
cardData.month = document.getElementById('expMonth').value;
cardData.year = document.getElementById('expYear').value;
cardData.cardCode = document.getElementById('cardCode').value;
var secureData = {};
secureData.authData = authData;
secureData.cardData = cardData;
// If using banking information instead of card information,
// send the bankData object instead of the cardData object.
//
// secureData.bankData = bankData;
window.Accept.dispatchData(secureData, this.handleANetResponse);
};
I've spent 2 hours on this problem, searching through various docs and questions/responses on this site. I have found nothing useful. I've tried changing and resetting the keys multiple times. I've set the accounts to live mode instead of test mode. I've tried various combinations of clientKey and loginID. I have tried with both sandbox keys and live merchant account keys.
Please advice as this project is on a very tight deadline.
Thanks in advance