Reply
Member
Posts: 9
Registered: ‎05-10-2012

Silent Post is empty

Hi,

 

We are getting strange behavious with Silent Posts having an empty request body. This happens sporadically. We are using AIM.

 

This situation is described in this post

http://community.developer.authorize.net/t5/Integration-and-Testing/POST-data-in-Silent-Post-is-empt...

 

The solution in the above post is to not use redirects after placing a purchase, we need to stop the page process and redirect to a thank_you_page. How to deal with this issue? Can I instead return html that will request the thank_you_page?

 

ASP.NET Example:

 

sub Page_Load()

 

{

.....

 

processAIM();

 

redirectToThankYouPage();

 

Response.End();

 

}

 

Thanks

 

 

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

Re: Silent Post is empty

What you describe is not silent post, it just your AIM process.

Are you checking to see if the transaction went thru in processAIM() like error or decline? Can you tell if your thank_you_page get call when you get empty request body? Are you just doing a response.redirect()? It there a reason for Response.End()?

 

Member
Posts: 9
Registered: ‎05-10-2012

Re: Silent Post is empty

Hi,

 

Thanks for your response. 

 

Sorry I was not clear before. The above code is my AIM request and not my Silent Post handler. The code should look more like this.

 

sub Page_Load()

 

{

.....

 

bool success = processAIM(); //returns true if transaction is approved, otherwise false.

 

if (success)

{

showUserPage("thank_you");

}

else

{

showUserPage("error");

}

 

The processAIM() returns a successful result. My question is how to implement the showUserPage(). I can either to a Response.Redirect(page). Or I can write html that will have javascript request that page:

 

void showUserPage(string page)

{

Response.Redirect(page);

}

 

---Or---

 

void showUserPage(string page)

{

Response.Write(<html><head><script>window.location= [page]</script></head><body></body></html>)

 

Response.End(); // I must call end because I only want this html to be returned to the user.

}

 

Using both of these implementations, the user can see my thank_you_page. Which of the showUserPage() implementations is better?  According to the link above, I should be using the second method, but I don't see how this will affect my silent post request body. Is Response.End() a problem? And if so, they why? 

 

As a side note, I am also testing ARB which also use Silent Post. I also sporadically get empty Silent Posts request bodies. Am I doing something wrong in general in regards to setting up silent posts?

 

Thanks

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

Re: Silent Post is empty

void showUserPage(string page)
{
Response.Write(<html><head><script>window.location= [page]</script></head><body></body></html>)
Response.End(); // I must call end because I only want this html to be returned to the user.
}

 Is better.

 

I was question about response.end(); in you original code. because it might end the response before redirectToThankYouPage(); is finish.

 

What do you think silent post do? We might just having a different idea of what it is.  Silent Post don't display anything to a web browser, so I'm not sure what you mean by empty request body, do you mean it didn't have any post values?  All the silent post page should do is update database or something.

 

Member
Posts: 9
Registered: ‎05-10-2012

Re: Silent Post is empty

Thanks for the response.

 

Again, sorry for not being totally clear. I have an ASP.NET application in C#. I have 2 pages that are in question: BuyNow.aspx, and HandleSilentPost.aspx. There are also 2 result pages (ThankYou.aspx, Error.aspx).

 

  1. Customer navigates to BuyNow.aspx and fills out billing details form (name, credit card, etc...)
  2. Customer submits the form back to BuyNow.aspx
  3. BuyNow.aspx uses AIM to send request Authorize.net to post transaction
  4. BuyNow.aspx receives response from Authorize.net.
  5. If response is successful, customer sees ThankYou.aspx
  6. If response is denied, user customer Error.aspx

 

Here is the psuedocode for BuyNow.aspx:

 

sub Page_Load() 

{

 

if (IsPostBack) //if credit card info is submitted

 {

bool success = processAIM(); //returns true if transaction is approved, otherwise false.

 

if (success)

{

showUserPage("thank_you");

}

else

{

showUserPage("error");

}

}

 

Also, inside Authorize.net, I set up a Silent Post Url to “https://[my site]/ HandleSilentPost.aspx”. The HandleSilentPost.aspx page is supposed to receive the Silent Post Parameters (in the request body) and save them to database.

 

It seems that this page is called by Authorize.net after I call processAim() in BuyNow.aspx, as it should.

 

The problem is that HandleSilentPost.aspx gets called with a POST request that has empty body, so nothing can be saved to database. Can you help me figure out why the body empty?

 

Thanks

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

Re: Silent Post is empty

Ok. I got it now. AIM is working fine. issue with silent post.

 

How did you know the HandleSilentPost.aspx is getting call? Are you writing log message? since silent post is simlar to relay response read this and see if it help. It is doing anything other than table I/O? Did you see any error message on the IIS server?

 

 

Member
Posts: 9
Registered: ‎05-10-2012

Re: Silent Post is empty

Hi,

 

We have a request logger inside HandleSilentPost.aspx that logs every request and body. When an empty request comes, there is a log entry but no body. There are no errors in IIS log. About 25% of silent posts are empty. Others are good.

 

We need to make it work because we use the silent post for fulfilling orders by generating licenses and emailing to customers, not just logging to database.

 

Any other thoughts?

 

Thanks

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

Re: Silent Post is empty

Since you are using AIM, the workaround is to read the response from your webrequest to authorize.net in your processAIM() method.

Member
Posts: 9
Registered: ‎05-10-2012

Re: Silent Post is empty

Thanks,

 

This solution will solve 50% of my problem. The other 50% has to do with ARB.

 

I also get sporadic empty silent posts when ARB is processed.

 

Any thoughts on that?

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

Re: Silent Post is empty

Maybe the detail transaction API?