Showing results for 
Search instead for 
Did you mean: 

API hosted form can't post after initial validation error

I am able to get the hosted form to come up and can process payments as long as the form validation passed. 


I am getting the following error whenever the user inputs an incorrect field.  I get the error message for the problem, then when it is corrected and clicking pay invoice I get an error "fingerprint value is not valid".  This is happening in the sandbox and production.  This example is in production, I entered an invalid expiration date:






Now the user is stuck and has to cancel and come back in to process the payment.  Also, I have the cancel event being captured via the iframe communicator and this does not work after this error so the iframe redirects to the cancelUrl passed in with the token request.  I can't get the cancel event to trigger unless I provide a cancel url.   Here is my javascript to handle the events:


$(document).ready(function () {


           window.CommunicationHandler = {};


function parseQueryString(str) {

var vars = [];

var arr = str.split('&');

var pair;

for (var i = 0; i < arr.length; i++) {

                   pair = arr[i].split('=');

                   vars[pair[0]] = unescape(pair[1]);


return vars;



           window.CommunicationHandler.onReceiveCommunication = function (argument) {

var params = parseQueryString(argument.qstr);


switch (params['action']) {

case "resizeWindow":

//alert('resizeWindow: width-' + params['width'] + ' height-' + params['height']);

var iFrame = document.getElementById('authNetIFrame');

                       iFrame.width = params['width'];

                       iFrame.height = params['height'];


case "cancel":

if (_paymentDetail) {






case "transactResponse":

var transResponse = JSON.parse(params['response']);


if (transResponse.responseCode == 1) {

var firstName = '';

var lastName = '';

var city = '';

var state = '';

var zip = '';

var address = '';


if (transResponse.billTo != 'undefined') {

                               firstName = transResponse.billTo.firstName;

                               lastName = transResponse.billTo.lastName;

                               city =;

                               state = transResponse.billTo.state;

                               zip =;

                               address = transResponse.billTo.address;


                           ProcessPaymentReceipt(transResponse.transId, transResponse.accountType, transResponse.accountNumber, firstName, lastName, city, state, zip, address);









Here is the C# code to build the request:


public getHostedPaymentPageResponse GetHostedResponse(String ApiLoginID, String ApiTransactionKey, decimal paymentAmount, bool testMode)


var borrGuid = "";

if (UserID == 0 && !string.IsNullOrEmpty(Borrower.AppraisalOrder.PaymentGuid))

                           borrGuid = Borrower.AppraisalOrder.PaymentGuid;


ApiOperationBase<ANetApiRequest, ANetApiResponse>.RunEnvironment = testMode ? AuthorizeNet.Environment.SANDBOX : AuthorizeNet.Environment.PRODUCTION;

ApiOperationBase<ANetApiRequest, ANetApiResponse>.MerchantAuthentication = new merchantAuthenticationType()


                           name = ApiLoginID,

                           ItemElementName = ItemChoiceType.transactionKey,

                           Item = ApiTransactionKey,



var transactionRequest = new transactionRequestType


                           transactionType = transactionTypeEnum.authCaptureTransaction.ToString(),    // authorize capture only

                           amount = paymentAmount,

                           poNumber = borrGuid



settingType[] settings = new settingType[9];


                     settings[0] = new settingType();

                     settings[0].settingName = settingNameEnum.hostedPaymentReturnOptions.ToString();

                     settings[0].settingValue = "{\"showReceipt\": false, \"cancelUrl\": \"" + AdminModel.BaseUrl + "\", \"cancelUrlText\": \"Cancel\"}";


                     settings[1] = new settingType();

                     settings[1].settingName = settingNameEnum.hostedPaymentButtonOptions.ToString();

                     settings[1].settingValue = "{\"text\": \"Pay Invoice\"}";


                     settings[2] = new settingType();

                     settings[2].settingName = settingNameEnum.hostedPaymentPaymentOptions.ToString();

                     settings[2].settingValue = "{\"cardCodeRequired\": false, \"showCreditCard\": true, \"showBankAccount\": false}";


                     settings[3] = new settingType();

                     settings[3].settingName = settingNameEnum.hostedPaymentSecurityOptions.ToString();

                     settings[3].settingValue = "{\"captcha\": false}";


                     settings[4] = new settingType();

                     settings[4].settingName = settingNameEnum.hostedPaymentShippingAddressOptions.ToString();

                     settings[4].settingValue = "{\"show\": false, \"required\": false}";


                     settings[5] = new settingType();

                     settings[5].settingName = settingNameEnum.hostedPaymentBillingAddressOptions.ToString();

                     settings[5].settingValue = "{\"show\": false, \"required\": false}";


                     settings[6] = new settingType();

                     settings[6].settingName = settingNameEnum.hostedPaymentCustomerOptions.ToString();

                     settings[6].settingValue = "{\"showEmail\": false, \"requiredEmail\": false, \"addPaymentProfile\": false}";


                     settings[7] = new settingType();

                     settings[7].settingName = settingNameEnum.hostedPaymentOrderOptions.ToString();

                     settings[7].settingValue = "{\"show\": false, \"merchantName\": \"\"}";


                     settings[8] = new settingType();

                     settings[8].settingName = settingNameEnum.hostedPaymentIFrameCommunicatorUrl.ToString();

                     settings[8].settingValue = "{\"url\": \"" + AdminModel.BaseUrl + "InvoiceCommunicator.html\"}";


var request = new getHostedPaymentPageRequest();

                     request.transactionRequest = transactionRequest;

                     request.refId = UserID.ToString();

                     request.hostedPaymentSettings = settings;


// instantiate the contoller that will call the service

var controller = new getHostedPaymentPageController(request);



// get the response from the service (errors contained if any)

var response = controller.GetApiResponse();


return response;


public string GetHostedFormToken()


string token = "";


if (Test)


if (!string.IsNullOrEmpty(TestLogin))


                                  Login                = TestLogin;

                                  TransactionKey       = TestTransactionKey;




Decimal amt = 0;

Decimal.TryParse(PmtFormAmount, out amt);


var logger    = NLog.LogManager.GetLogger("AuthorizeNet");

var resp      = GetHostedResponse(Login,TransactionKey, amt, Test);



if (resp != null && resp.messages.resultCode == messageTypeEnum.Ok)


                           token = resp.token;



                     logger.Debug(() => String.Format("HostedFormToken: [{}{}{0}] : token  ", Borrower.BorrowerID.ToString()) + token);


return token;




Thanks for your help.


I have tried the following based on your request in sandbox in our test page. Dont see any issue. 

Can you let me know more about -- whenever user inputs incorrect field. we expose the fields you want based on the settings in the below request. so i believe that there wouldnt be any incorrect fields. 



<getHostedPaymentPageRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
      <description>Order description</description>
        <description>line item 1 description</description>
        <description>line item 2 description</description>
      <name>tax name</name>
      <description>tax descryption</description>
      <name>tax name</name>
      <description>duty description</description>
      <name>freight name</name>
      <description>freight description</description>
      <company>Test Company</company>
      <address>1234 Test Ave N.E.</address>
      <city>Test Bellevue</city>
      <phoneNumber>425 111 2222</phoneNumber>
      <faxNumber>425 111 2222</faxNumber>
      <company>Test &amp; Company</company>
      <address>Ship to 1234 Test Ave N.E.</address>
      <city>Test &amp; Bellevue</city>
      <settingValue>{"cardCodeRequired": true, "showCreditCard":true, "showBankAccount":false}</settingValue>
      <settingValue>{"captcha": false}</settingValue>
      <settingValue>{"show": false, "required": false}</settingValue>
      <settingValue>{"show":false, "required": false}</settingValue>
      <settingValue>{"show": false}</settingValue>
      <settingValue>{"showEmail": false, "requiredEmail": false, "addPaymentProfile": false}</settingValue>


Authorize.Net Expert Authorize.Net Expert
Authorize.Net Expert

by incorrect fields I mean they enter an invalid value, so in the sandbox while testing I entered the invalid zip code 46282 and receive a transaction declined message.  Then when I change to a valid zip code I get the invalid fingerprint error.  It doesn't matter what field value is invalid, I was displaying the address information as well. When I would enter an invalid zip code for the card being used, I get an address mismatch error then when corrected I get the fingerprint error and can't continue.  Is there a minimum version of jquery that is acceptable? 

mcarvar8, I am able to repro your issue in sandbox . But doing the same in our lower env. 

Will get back to you tomorrow.



Authorize.Net Expert Authorize.Net Expert
Authorize.Net Expert

 mcarvar8, able to reproduce this issue in our lower enviornment too and reported to the internal team. While we fix the issue, Workaround suggested by dev(@surya) was to regenerate token fresh in this scenario.



Authorize.Net Expert Authorize.Net Expert
Authorize.Net Expert

Is there any idea on a timeline of when to expect this to be fixed?  Because I lose communication back to the iframe communicator in my site I have no idea there is an issue, thus I can't trigger a new token. 

I'm reproducing the same issue.


A band-aid fix we implemented is to change the "Cancel" button into a "Reset Form and Try Again" button, which reloads the page. It's definetely not the best solution, but it gives users at least SOME option.


This is a really significant flaw that makes it hard for us to propose Accept Hosted as a replacement for SIM. Until this is fixed we'll probably need to suggest an alternative gateway to our users.


We gave up on this solution and switched to Accept Js with our own custom form.  It was easy to implement and gave us full control, plus it kept our user experience the same as our original SIM solution.  We just had to build the new API calls for transaction processing in C#. 

Hi @eventespresso @mcarver8


This issue has been already reported to the dev team .

I will keep the thread posted once its released .




Send feedback at

Anurag --


Is there any update on this?