cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot get Accept.js to work with my own form

I am trying to use Accept.js with own form on our website.  

I call Accept.dispatchData(secureData, responseHandler);  and that appears to work correctly, if I enter all the form values corectly, it does not return any error. If I enter say the credit number incorrectly it detects that returns the corresponding error code.

 

E_WC_05Please provide valid credit card number.

However, if all my values are correct, my form just posts back and does nothing else.  The next line in sequence that should have been executed is as under:

paymentFormUpdate(response.opaqueData);

It does not get executed. ThepaymentFormUpdate function has been taken from the sample code and has not been changed, except changing the field name to match the variable names that I have . I am listing it below for reference.

function paymentFormUpdate(opaqueData) {
document.getElementById("dataDescriptor").value = opaqueData.dataDescriptor;
document.getElementById("dataValue").value = opaqueData.dataValue;

// If using your own form to collect the sensitive data from the customer,
// blank out the fields before submitting them to your
document.getElementById("txtAmountPaid").value = "";
document.getElementById("txtTotalCharge").value = "";
document.getElementById("txtCreditCardNumber").value = "";
document.getElementById("txtpMonth").value = "";
document.getElementById("txtYear").value = "";
document.getElementById("txtSecurityCode").value = "";
//document.getElementById("accountNumber").value = "";
//document.getElementById("routingNumber").value = "";
///document.getElementById("nameOnAccount").value = "";
//document.getElementById("accountType").value = "";

document.getElementById("paymentForm").submit();
}

When truing to debug the program, it does not appears to be going into thepaymentFormUpdate  function, makes me suspicious there is no value in opaqueData 

Also, when there are no errors in the call toAccept.dispatchData(secureData, responseHandler);  it does not return

I_WC_01Successful.

even when there are no errors. 

I am up against a deadline and have tried my luck everywhere, in vain.  Will really appreciate any help from aynone who might have experienced anything similar. 

vineet1905
Member
1 REPLY 1

Have you checked your API login key and public client key?  If these keys are missing or incorrect then you will not receive the opagueData values.  Rather, you might see this error, E_WC_21: User authentication failed due to invalid authentication values.

 

 

Burke
Member