Reply
Highlighted
Contributor
Posts: 27
Registered: ‎03-30-2012

Required Fields for DPM using ASP.NET

I have been receiving the following error when attempting to post using DPM and ASP.NET:

 

(13) The merchant login ID or password is invalid or the account is inactive.

 

I am currently including the following fields:

 

x_card_num

x_exp_date

x_card_code

x_amount

x_tax

x_first_name

x_last_name

x_address

x_city

x_state

x_zip

x_ship_to_first_name

x_ship_to_last_name

x_ship_to_address

x_ship_to_city

x_ship_to_state

x_ship_to_zip

x_login

x_tran_key

x_fp_sequence

x_fp_timestamp

x_fp_hash

x_relay_url

x_relay_response

 

I am posting to the following URL using a developer account:

 

https://test.authorize.net/gateway/transact.dll

 

The account is in LIVE MODE. Are there any other fields I should or need to include, or any settings I should check or set? I can't figure out what the problem could be, or what steps I should take next to try to get everything working. Any help would be appreciated. Thanks.

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Required Fields for DPM using ASP.NET

[ Edited ]

The min fields for DPM (is form the documentation - section JAVA)

<form id='secure_redirect_form_id' action='https://test.authorize.net/gateway/transact.dll' method='POST'>
<input type='text' class='text' id='x_card_num' name='x_card_num' size='20' maxlength='16' />
<input type='text' class='text' id='x_exp_date' name='x_exp_date' size='6' maxlength='6'/>
<input type='hidden' name='x_invoice_num' value='<%=System.currentTimeMillis()%>' />
<input type='hidden' name='x_relay_url' value='<%=relayResponseUrl%>' />
<input type='hidden' name='x_login' value='<%=apiLoginId%>' />
<input type='hidden' name='x_fp_sequence' value='<%=x_fp_sequence%>' />
<input type='hidden' name='x_fp_timestamp' value='<%=x_fp_timestamp%>' />
<input type='hidden' name='x_fp_hash' value='<%=x_fp_hash%>' />
<input type='hidden' name='x_version' value='3.1' />
<input type='hidden' name='x_method' value='CC' />
<input type='hidden' name='x_type' value='AUTH_CAPTURE' />
<input type='hidden' name='x_amount' value='<%=amount%>' />
<input type='hidden' name='x_test_request' value='FALSE' />
<input type='hidden' name='notes' value='extra hot please' />
<input type='submit' name='buy_button' value='BUY' />
</form>

 And you do NOT pass the x_tran_key

 

Did you look at the page source when you run the web page on the browser? to make sure everything is pass correctly?

Highlighted
Contributor
Posts: 27
Registered: ‎03-30-2012

Re: Required Fields for DPM using ASP.NET

I have included all the fields you mention, and removed the x_tran_key field, but still same error. I have also viewed the page source and it is what I expect, but still not success. Any other ideas? Thanks.

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Required Fields for DPM using ASP.NET

If and only if this is a test account, post the web broswer page source here.

Highlighted
Contributor
Posts: 27
Registered: ‎03-30-2012

Re: Required Fields for DPM using ASP.NET

[ Edited ]

Here is the page source from the page:

 

The form tag is:

 

<form name="aspnetForm" method="post" action="https://test.authorize.net/gateway/transact.dll" id="aspnetForm" onsubmit="mckeepottery_com.MPWebServices.GenerateTimestamp(function(value){document.getElementById('x_fp_timestamp').value=value;});mckeepottery_com.MPWebServices.GenerateFingerprint('35LF5Mx3ryh4E52G','XXXXXXXXXXX',126.0000,'43',document.getElementById('x_fp_timestamp').value,function(value){window.setTimeout('document.getElementById('x_fp_hash').value=value;',1000);});">

 

The input fields are:

 

<input id="x_card_num" type="hidden" value="4007000000027"/><input id="x_exp_date" type="hidden" value="1212"/><input id="x_card_code" type="hidden" value=""/><input id="x_amount" type="hidden" value="126.00"/><input id="x_tax" type="hidden" value="6.00"/><input id="x_first_name" type="hidden" value="Nathan"/><input id="x_last_name" type="hidden" value="Sokalski"/><input id="x_address" type="hidden" value="1217 Maryland Avenue"/><input id="x_city" type="hidden" value="Allentown"/><input id="x_state" type="hidden" value="PA"/><input id="x_zip" type="hidden" value="18103"/><input id="x_ship_to_first_name" type="hidden" value="Nathan"/><input id="x_ship_to_last_name" type="hidden" value="Sokalski"/><input id="x_ship_to_address" type="hidden" value="1217 Maryland Avenue"/><input id="x_ship_to_city" type="hidden" value="Allentown"/><input id="x_ship_to_state" type="hidden" value="PA"/><input id="x_ship_to_zip" type="hidden" value="18103"/><input id="x_login" type="hidden" value="XXXXXXXXXXX"/><input id="x_fp_sequence" type="hidden" value="43"/><input id="x_test_request" type="hidden" value="TRUE"/><input id="x_fp_timestamp" type="hidden"/><input id="x_fp_hash" type="hidden"/><input id="x_relay_url" type="hidden" value="http://www.mckeepottery.com/catalog/Receipt.aspx"/><input id="x_relay_response" type="hidden" value="TRUE"/><input id="x_version" type="hidden" value="3.1"/><input id="x_method" type="hidden" value="CC"/><input id="x_type" type="hidden" value="AUTH_CAPTURE"/>

 

You will notice that the form tag uses two WebMethods to set the x_fp_timestamp and x_fp_hash fields so that the timestamp is at the time it is submitted. Here is the codebehind code I used for the WebMethods:

 

Imports System.Web.Services

<ScriptService()> Public Class MPWebServices : Inherits System.Web.Services.WebService

<WebMethod()> Public Function GenerateTimestamp() As String

   Return AuthorizeNet.Crypto.GenerateTimestamp().ToString()

End Function

<WebMethod()> Public Function GenerateFingerprint(transactionkey As String, login As String, amount As Decimal, sequence As String, timestamp As String) As String

   Return AuthorizeNet.Crypto.GenerateFingerprint(transactionkey, login, amount, sequence, timestamp)

End Function End Class

 

If you need the rest of the code, I can send it, but these are the lines that seemed like they were the most significant. Thanks.

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Required Fields for DPM using ASP.NET

It not working because you can NOT use a production login ID on the test server https://test.authorize.net/gateway/transact.dll

 

I try it on secure.authorize.net and getting a code (99) https://developer.authorize.net/tools/responsecode99/ with a fake transactionKey, which is expected.

 

Get a test account https://developer.authorize.net/testaccount/

and test in to https://test.authorize.net/gateway and set x_test_request to "false"

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Required Fields for DPM using ASP.NET

Another thing.

The way you have for GenerateFingerprint methods on the page is not secure.

The point for the fingerprint is 1)hide you transactionKey, because with both loginID and transactionKey, someone could use your info to test CC#. 2)make sure the amount is not tampered with, since both in on the form, someone change the amount from something like 126.00 to 12.60.

 

P.S. you have 4 decimal on the amount for the GenerateFingerPrint, it should only be just 2.

Highlighted
Contributor
Posts: 27
Registered: ‎03-30-2012

Re: Required Fields for DPM using ASP.NET

I am using a test account from https://developer.authorize.net/testaccount/ Is there something that I could possibly need to change in the account that could be causing the code to think it is not a test account? To try it on secure.authorize.net with a fake transaction key, where would I get the fake transaction key? Thanks.

Highlighted
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: Required Fields for DPM using ASP.NET

It is from a test account? I think you will better off  getting a new test account, it sound like it mess up on something on authorize.net side and it is not code related. Maybe one on the MOD will know what to do with that one.

 

A fake transaction key is just that could be ABCD could be 1234. The point is that with the loginID on secure.authorize.net is returning error code 99 meaning the fingerprint is not valid, but the loginID is valid(not getting error 13).

Highlighted
Contributor
Posts: 27
Registered: ‎03-30-2012

Re: Required Fields for DPM using ASP.NET

I got a new test account and am using the new Api Login Id and Transaction Key, but still same problem. I also tried a fake transaction key, no difference.