Reply
Contributor
Posts: 20
Registered: ‎07-13-2011

Re: Direct Post Method (DPM) not working

[ Edited ]

Ok, well I'm not following that because a plain .html page will accept a form post, it just will ignore everything else in the post.  I don't see how AuthorizeNet can really investigate the relay.  I would think it simply posts data to the relay page and moves on.

 

However, I set up a page that could take a form post and I am still getting an error.  The page simply spits out a few things

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="AuthRelay.aspx.vb" Inherits="SinglePageCO.AuthRelay" %>

<!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 runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        Thank you<br />
        You have arrived<br />
        <asp:Label ID="LblResponseCode" runat="server" Text="Label"></asp:Label>
        <br />
        <asp:Label ID="LblRespReason" runat="server" Text="Label"></asp:Label>
        <br />
        <asp:Label ID="LblTranCode" runat="server" Text="Label"></asp:Label>
        <br />
        <asp:Label ID="LblAuthCode" runat="server" Text="Label"></asp:Label>
        <br />
        <asp:HyperLink ID="HLkRedirect" runat="server">Click to Continue</asp:HyperLink>
    
    </div>
    </form>
</body>
</html>

 Codebehind

Public Class AuthRelay
    Inherits System.Web.UI.Page
    Dim ResponseCode As String = Trim(Request.Form("x_response_code"))
    Dim ResponseReasonText As String = Trim(Request.Form("x_response_reason_text"))
    Dim ResponseReasonCode As String = Trim(Request.Form("x_response_reason_code"))
    Dim AVS As String = Trim(Request.Form("x_avs_code"))
    Dim TransID As String = Trim(Request.Form("x_Trans_ID"))
    Dim AuthCode As String = Trim(Request.Form("x_Auth_Code"))
    Dim Amount As String = Trim(Request.Form("x_Amount"))
    Dim ReceiptLink As String = "http://www.authorizenet.com"

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        LblResponseCode.Text = ResponseCode
        LblRespReason.Text = ResponseReasonText
        LblAuthCode.Text = AuthCode
        LblTranCode.Text = TransID
        HLkRedirect.NavigateUrl = ReceiptLink
    End Sub

End Class

 Your link http://developer.authorize.net/downloads/samplecode/ has a sample .asp relay response...I'm going to try that one next.  It is classic asp but should work on this server.

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

Re: Direct Post Method (DPM) not working

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

Contributor
Posts: 20
Registered: ‎07-13-2011

Re: Direct Post Method (DPM) not working

Ok, actually it appears I just had an error in my code.