Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to read HTTP-POST data from Authorize.net Relay Response

Status
Not open for further replies.

joshbula

Technical User
Nov 19, 2004
45
US
I am using Authorize.net's Server Integration Method, trying to get relay_response to work where they do an HTTP POST to a page back on my server with information about the credit card transaction that just occurred so I can display a receipt and update the database.

It is displaying the response page fine, but there is no data displayed... it's as if there was no form data posted to it at all, the same as if you just typed in the URL.

However, when I use as the response url I can see the dump of all posted data, so I know the problem is probably not with Authorize.net but something with my code or server. However, when I post to my response page from a test page, it DOES recognize and display the posted data, so I know the page is handling the posted data correctly.

Here's the code I'm using to get the POST data:
Code:
  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Response.Expires = 0  '--I've tried with and without the Response.Expires

            Dim s_x_response_code As String = ""
            If Not String.IsNullOrEmpty(Request.Form("x_response_code")) Then
                s_x_response_code = Request.Form("x_response_code")
            End If

            Dim n_x_response_reason_code As Integer = 0
            If Not String.IsNullOrEmpty(Request.Form("x_response_reason_code")) Then
                n_x_response_reason_code = CInt(Request.Form("x_response_reason_code"))
            End If

            Dim s_x_response_reason_text As String = ""
            If Not String.IsNullOrEmpty(Request.Form("x_response_reason_text")) Then
                s_x_response_reason_text = Request.Form("x_response_reason_text")
            End If

            Dim s_x_auth_code As String = ""
            If Not String.IsNullOrEmpty(Request.Form("x_auth_code")) Then
                s_x_auth_code = Request.Form("x_auth_code")
            End If

            Dim s_x_invoice_num As String = ""
            If Not String.IsNullOrEmpty(Request.Form("x_invoice_num")) Then
                s_x_invoice_num = Request.Form("x_invoice_num")
            End If

            Dim s_x_description As String = ""
            If Not String.IsNullOrEmpty(Request.Form("x_description")) Then
                s_x_description = Request.Form("x_description")
            End If

            Dim s_x_amount As String = ""
            If Not String.IsNullOrEmpty(Request.Form("x_amount")) Then
                s_x_amount = Request.Form("x_amount")
            End If

            If s_x_response_code = "1" Then
                UpdateTransaction(s_x_invoice_num)
                lblDescription.Text = "TRANSACTION APPROVED!! <BR /> A receipt has been sent to the e-mail address you provided on the previous screen.<br /><br />" & _
                    s_x_description & "<br />Total Amount: " & s_x_amount & "<br />Approval Code: " & s_x_auth_code
            Else
                lblDescription.Text = "YOUR CARD HAS BEEN DECLINED!!!!<BR />" & s_x_response_code & "<br />" & s_x_response_reason_text & "<br /><br />"
               
            End If
        End Sub


In searching the Authrize.net developer forums, I found that someone was told by Authorize.net support that you can't use ASP.NET with Relay Response, you have to use classic ASP (which I really don't want to do), but others have gotten it to work using EnableViewStateMAC="false" so I do have hope that this is possible and there is just something else that I haven't thought about yet. I used their classic asp sample code and converted it to .net and that didn't work either.

Any help would be greatly appreciated!!!!
 
I don't see how we can help you with this, as it is not an ASP.NET issue. You will have to get help from the vendor or go to their forums as you have been. If you paid for this, I suggest you get phone support and verify if their product can be used with .NET. I would be surprised if it didn't, unless this is a very old product or version of it.
 
I know... I was just thinking that someone here might have experience with Authorize.net since they are a fairly popular service. I have posted this on their forums and sent two support e-mails but have had no response, other than to tell me to hire one of their "certified" developers. There might also be some kind of .NET issue that I have not yet run across in my limited experience with Request.Form() in .Net. ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top