cancel
Showing results for 
Search instead for 
Did you mean: 

Direct Post Method (DPM) not working

Popular shopping cart vender with connections to all the other AuthorizeNet api's already and now I'm trying to use the new DPM method.  Unfortunately, the sandbox gives you no "debug" information on errors.  It just says transaction can't process, go fish.  I have a very simple form that should be working and nothing obvious that should be a problem.

 

Here is the form page below. Note to_hash is simply debug code to show me the string that needs to be fingerprinted and it looks good to go.  I'm using authorizeNet's EncryptHMAC function.  I did rewrite it to vb.net but it seems to be functioning correctly from what I can tell.

 

Can someone please tell me why this is not working?

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
	testing
</title></head>
<body>
 
<form id='secure_redirect_form_id' action='https://test.authorize.net/
gateway/transact.dll' method='post'>
<label for='x_card_num'>Credit Card Number</label>
<input type='text' class='text' id='x_card_num' name='x_card_num' 
size='20' maxlength='16' />
<br />
<label for='x_exp_date'>Expiration Date</label>
<input type='text' class='text' id='x_exp_date' name='x_exp_date' size='6' 
maxlength='6'/>
<br />
<label for='x_amount'>Amount</label>
<input type='text' class='text' id='x_amount' name='x_amount' size='10' 
maxlength='10' readonly='readonly' value='1.99' />
<br />
<input type='hidden' name='x_invoice_num' 
value='14' />
<input type='hidden' name='x_relay_url' value='http://www.microsoft.com' />
<input type='hidden' name='x_login' value='6P8aEm5q' />
 
<input type='hidden' name='x_fp_sequence' value='14' />
<input type='hidden' name='x_fp_timestamp' value='1353539796' />
<input type='hidden' name='x_fp_hash' value='1f2918442389819905ef8467f438b4c0' />
<input type='hidden' name='to_hash' value='6P8aEm5q^14^1353539796^1.99^' />

<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='1.99' />
<input type='hidden' name='x_test_request' value='TRUE' />
<input type='hidden' name='notes' value='extra hot please' />
<input type='submit' name='buy_button' value='BUY' />
</form>
</body>
Direct Post Method Developer Guide | November 2012
70
</html>

 P.S.  fix your gateway to spit out debug details.  It is a sandbox so there is nothing secret about having the sandbox tell you what is wrong "generically" with the post.

spastic
Contributor
2 ACCEPTED SOLUTIONS

Accepted Solutions

Can you set the relay response url to https://developer.authorize.net/tools/paramdump/index.php

So you can see the response. and tell us what the response are?

 

P.S. since you are using test account there is no point of setting this to true

<input type='hidden' name='x_test_request' value='TRUE' />

View solution in original post

RaynorC1emen7
Expert

Just remembered, there is vb.net sample code for SIM here, which have the code to generate the x_fp_hash.

View solution in original post

13 REPLIES 13

Can you set the relay response url to https://developer.authorize.net/tools/paramdump/index.php

So you can see the response. and tell us what the response are?

 

P.S. since you are using test account there is no point of setting this to true

<input type='hidden' name='x_test_request' value='TRUE' />
RaynorC1emen7
Expert

Thanks for your reply and your help.

 

Yeh, I don't think the test request is going to make a difference.  I have set that to true and false.

I changed the relay response to what you suggested.....and I get the same error...which is:

 

An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card. 

      This transaction cannot be accepted. 
      
 

 The email you receive is this:

 

**Please DO NOT REPLY to this message. E-mail developer@authorize.net if you have any questions.

Authorize.Net Developer Center Merchant,

Your script timed out while we were trying to post transaction results to it.
   Transaction ID: 0
Transaction Result: This transaction cannot be accepted.

The following message was displayed to the customer:

------------------------------An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

This transaction cannot be accepted.


------------------------------

 Neither are useful.

When I go to that url directly it says:

Page Not Found   Sorry, the page you requested was not found or may have been moved. In order to find the correct page, we suggest the following:

Ok, I did a search for the correct URL on that param dump and found it.

This is what I get:

I think that is saying the Hash is not correct.  However, I am using AuthorizeNET's hash algorithm to generate it.  The only thing I did was convert the code to VB.NET from C#.

 

REMOTE_ADDR: 10.1.186.51 
REQUEST_METHOD: POST 
HTTP_REFERER: none 
Field Name Field Value 
x_response_code 3 
x_response_reason_code 99 
x_response_reason_text (TESTMODE) This transaction cannot be accepted. 
x_avs_code P 
x_auth_code 000000 
x_trans_id 0 
x_method CC 
x_card_type  
x_account_number  
x_first_name  
x_last_name  
x_company  
x_address  
x_city  
x_state  
x_zip  
x_country  
x_phone  
x_fax  
x_email  
x_invoice_num  
x_description  
x_type auth_capture 
x_cust_id  
x_ship_to_first_name  
x_ship_to_last_name  
x_ship_to_company  
x_ship_to_address  
x_ship_to_city  
x_ship_to_state  
x_ship_to_zip  
x_ship_to_country  
x_amount 1.99 
x_tax 0.00 
x_duty 0.00 
x_freight 0.00 
x_tax_exempt FALSE 
x_po_num  
x_MD5_Hash D783025B930DA650F51D4AAA40B0B6CE 
x_cvv2_resp_code  
x_cavv_response  
x_test_request true 
to_hash 6P8aEm5q^14^1353551206^1.99^ 
my_hash Bxhoq1cA68L8sobmU3X67A== 
notes extra hot please 
buy_button BUY 

 

use the Response Code 99 Tool to test your x_fp_hash or post your vb.net rewrite.

Just remembered, there is vb.net sample code for SIM here, which have the code to generate the x_fp_hash.

Ok, I have confirmed the hash is working now from that last sample.

 

I still get a failure though when I set the relay response to my url:

 

An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

      This transaction has been approved.

It is advisable for you to contact the merchant to verify that you will receive the product or service.

 

But it looks fine when I look at the relay post url

 

REQUEST_METHOD:POST
HTTP_REFERER:none

This is a test mode transaction.

Field Name Field Value
x_response_code1
x_response_reason_code1
x_response_reason_text(TESTMODE) This transaction has been approved.
x_avs_codeP
x_auth_code000000
x_trans_id0
x_methodCC
x_card_typeVisa
x_account_numberXXXX1111
x_first_name 
x_last_name 
x_company 
x_address 
x_city 
x_state 
x_zip 
x_country 
x_phone 
x_fax 
x_email 
x_invoice_num14
x_description 
x_typeauth_capture
x_cust_id 
x_ship_to_first_name 
x_ship_to_last_name 
x_ship_to_company 
x_ship_to_address 
x_ship_to_city 
x_ship_to_state 
x_ship_to_zip 
x_ship_to_country 
x_amount1.99
x_tax0.00
x_duty0.00
x_freight0.00
x_tax_exemptFALSE
x_po_num 
x_MD5_HashD783025B930DA650F51D4AAA40B0B6CE
x_cvv2_resp_code 
x_cavv_response 
x_test_requesttrue
to_hash6P8aEm5q^14^1353959556^1.99^
my_hashH5ElviAaai5Ubv5G3RHMLg==
notesextra hot please
buy_buttonBUY

first go thru the check list in Relay Response Basics and Troubleshooting

 

then for asp.net set EnableViewStateMac="false" on both page the post to authorize.net and the relay response page.

Ok, this is DPM not SIM, but I assume it is the same.  I actually put the relay url to a basic website...just to show completion....  I think I even tried www.microsoft.com.   I assume the relay url can just be a plain old url that does nothing....

need to be a page that can accept a form post to it. so just a .html page will not work. The other thing that I remember is that the relay page can't have any field with the same name as any of the response field name. e.g. x_response_code.

 

Can you post the relay response page.