cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Duplicate Response from Authorize.Net to silent post url ....

finally got this authorize.Net working using SIM method.I save the response data in the silent post url to my database.

But now the issue is that that the silent url is getting response twice, as a result data getting saved twice in database.

Does any one know the reason.

jay3dec
Contributor
9 REPLIES 9

No reason why that should happen. Can you log the callback data to a text file (use the following if PHP) and then paste it here for the two callbacks you get?

 

$logfile = "path to logfile";
$handle = fopen($logfile, 'a');

foreach (array('fields', 'you', 'do', 'not', 'want', 'logged') as $key)
    unset($_POST[$key]);

fwrite($handle, print_r($_POST, true));

 

TJPride
Expert

i'm using .Net c#.

i think u misunderstood my question.What i meant is that silent post url is getting response twice for a transaction.

So my silent post url page is called twice.

I tried logging my code and found that my silent post url loaded twice and both the time i'm getting same transaction Id.

 

here is my log......i have logged the trans Id

 


[2011-10-12 11-45-15]         Information[transa id value]2164425486
[2011-10-12 11-45-15]         Information[amount value]19.00

[2011-10-12 11-45-16]         Information[transa id value]2164425486
[2011-10-12 11-45-16]         Information[amount value]19.00


i dont how to make it more clear......but this is wat i'm getting..... 

 

 

I tried my silent post url using the virtual terminal tool.It seems to work fine.But while trying this from 

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

 

it gets called twice.....

Is it giving the same status codes and so on? Has to be some way to print out the response data in some readable format so we can see if they're exactly the same or not.

This is my Silent post url code (c#)

 

public partial class Silent : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Form["x_response_code"] != null)
                ProcessLog.Write("PageLoad_SIMExample", Request.Form["x_response_code"].ToString(), LogMsgType.Information);
        }
    }

 As per this code , it logs the reponse code to log file.

And here is my log file.

 

[2011-10-12 23-25-55]         Information
[PageLoad_SIMExample]
1

[2011-10-12 23-25-55]         Information
[PageLoad_SIMExample]
1

 And u can c that when i called this once it logged the response code twice which means the silent url was called twice.any guesses y its so??

We need all of the response, not just one field.

Sorry for not listing all response codes.......

 

This is my c# code....

 if (Request.Form["x_response_code"] != null)
                {
                    ProcessLog.Write("transa id value", Request.Form["x_trans_id"].ToString(), LogMsgType.Information);
                    ProcessLog.Write("amount value", Request.Form["x_amount"].ToString(), LogMsgType.Information);
                    ProcessLog.Write("response code", Request.Form["x_response_code"].ToString(), LogMsgType.Information);
                    ProcessLog.Write("resposne reason code", Request.Form["x_response_reason_text"].ToString(), LogMsgType.Information);
                    ProcessLog.Write("md5 Hash", Request.Form["x_MD5_Hash"].ToString(), LogMsgType.Information);
                    ProcessLog.Write("first name", Request.Form["x_first_name"].ToString(), LogMsgType.Information);
                }

 And here is the resulting log...

 

[2011-10-13 03-55-41]         Information
[transa id value]
2164468350

[2011-10-13 03-55-41]         Information
[amount value]
19.00

[2011-10-13 03-55-41]         Information
[response code]
1

[2011-10-13 03-55-41]         Information
[resposne reason code]
This transaction has been approved.

[2011-10-13 03-55-41]         Information
[md5 Hash]
ED4CCF7213677A34BCC3E144ED20BEEF

[2011-10-13 03-55-41]         Information
[first name]
iu

[2011-10-13 03-55-41]         Information
[transa id value]
2164468350

[2011-10-13 03-55-41]         Information
[amount value]
19.00

[2011-10-13 03-55-41]         Information
[response code]
1

[2011-10-13 03-55-41]         Information
[resposne reason code]
This transaction has been approved.

[2011-10-13 03-55-41]         Information
[md5 Hash]
ED4CCF7213677A34BCC3E144ED20BEEF

[2011-10-13 03-55-41]         Information
[first name]
iu

Well, the callback looks identical, don't see any reason why you should be getting two. Unless of course you're doing something odd like having a function for handling the callback and then calling it twice by mistake from your callback page. I would think this would be easy to work around, however, since every callback has a transaction ID and ll you need to do is store the ID and then check to see if you already have a record with that ID.

ya i guess dat will do fine.....checking each time if a transaction id already exists and then saving to database.

i guess each transaction id will be unique...if it is den it will work for me unless a better solution is available for this..