Ayrab
Ayrab

Reputation: 336

Authorize.Net Accept Hosted Form constantly failing to display correctly

Background:

I'm currently developing a .NET MVC application and attempting to integrate the Authorize.Net payment gateway with it. I've downloaded the Authorize.net SDK through Nuget to use within my app.

Primary order information is collected within my app and then the user is redirected to the Authorize.Net Accept Hosted form. (My client doesn't want any credit card entry on/from their site so that eliminates the Iframe/.js solutions from AuthNet)

Issue:

I've worked through all of the initial issues with the AuthNet integration and I'm now dealing with the absolute frustration of having to figure out why the hosted form shows correctly on occasion (VERY RARE), shows only an "Order Summary" header on other occasions, shows "Missing or invalid token" on yet other occasions and most of the time just plain doesn't appear at all.

I can post the code but it's not the code. I'm using the same records to test with - to ensure consistency on my end - and they have all, at one point or another, been successfully sent to the AuthNet form and processed correctly...but this is few and far between at this point.

I'm using the Authorize.Net provided SDK and I've already figured out the idiosyncrasies with it which is why the form appears sometimes. It can't be what I'm sending up otherwise it wouldn't work ALL the time rather than just some of the time.....

Things I've Tried to Resolve the Problem

  1. Set the Authorize.Net account to "Live" Mode
  2. Downgraded to SDK version 1.9.6 instead of 2.0.1 because, apparently, the older version was better than the new one.
  3. Ensured that all of my HostedPayment* options are correctly set and the values are appropriately formatted.
  4. Checked the Authorize.Net developer forums
  5. Checked on StackOverflow
  6. Searched the web
  7. Pulled all my hair out

Question:

Has anyone else run into problems getting the Accept Hosted Form to display consistently? If so, then how did you resolve the issue to make the form render correctly on a consistent basis? I mean REALLY consistently, not once every 30-40 tries.

Missing or invalid token

Accept Hosted Form at it's finest!

Seriously! It's incredibly frustrating!

Upvotes: 2

Views: 907

Answers (1)

Ayrab
Ayrab

Reputation: 336

Ok - I walked my code and realized it wasn't my code but it was the refId that i as passing to the AuthNet form. Authnet allows you to pass up a refId as a 20 character string. My app uses GUIDs for this but a GUID is too long to fit in AuthNet's limited space so I compressed it using Ascii85. This "compression" changes the alphanumeric values to a combination of alphas, numbers and special characters.

I had a feeling that this may have been the case but the form was presented correctly, at times, even when the refId submitted had special characters. I decided to shift to a different tracking strategy and the form is now consistently appearing. It was the refId after all.

Upvotes: 1

Related Questions