Integration and Testing

Authorize.Net API questions and help with your payment integration.

Reply
Contributor
Posts: 16
Registered: ‎08-18-2012
Accepted Solution

DPM results capture.

[ Edited ]

C# asp.net .Net version 4.0

 

ASPX web application running in iFRAME

 

Ok, I truly can't get the relay to work, even after following all the rules and setup.

 

So,

 

This is now a basic capture from the same page I post to the Authorize.Net dll.

 

When I get back the response, I can choose from a coma delim list, or xml fields.

 

This seems like a basic web page problem now:

 

The page gets data, but I don't get a postback event, after I post. So how can I capture the results of, say, a comma delimited list?

 

R

 

 


Accepted Solutions
Solution
Accepted by topic author rachmann
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: DPM results capture.

Using your relay response page. I found somthing interesting. When you use a id with the same name that is posting from authorize.net e.g. x_response_reason_text . it getting a script timeout, But if I change it, just by adding a 1 .e.g. x_response_reason_text1, it run fine. Not sure if it is a bug(or security feature?) on asp.net or authorize.net.

 

So the problem as the textbox with that id.

View solution in original post


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

Re: DPM results capture.

ASPX web application running in iFRAME

Why?

 

Ok, I truly can't get the relay to work, even after following all the rules and setup.

Did you go thru the check list here  Relay Response Basics and Troubleshooting

 

This is now a basic capture from the same page I post to the Authorize.Net dll.

???

 

When I get back the response, I can choose from a coma delim list, or xml fields.

Delimited list is for AIM, not sure what xml fields are you referring to.

 

The page gets data, but I don't get a postback event, after I post. So how can I capture the results of, say, a comma delimited list?

If you posting in a iframe, it will be the page on iframe that handle the response. And My guess is that the response is in the https://test.authorize.net/gateway/transact.dll which you don't have access to.

 

So you can either go AIM, or figure out why relay response isn't working.

Contributor
Posts: 16
Registered: ‎08-18-2012

Re: DPM results capture.

This is in an IFRAME because this is an .Net 4 Web Application running inside of a web site. I think It's eventualy meant to be running as a stand alone tool within any similar type of web site - of the same genre. As an example, think movie theatres - they have the same business domain across the industry so this might be a tool to work on any movie ticketing site. This is not for movie ticket sites, or even ticket sites, but it was an example of similar domain across implementation.

 

I will check out the link for relay - thanks - why isn't that link on the DPM 'get started' page?

 

In DPM - set 

        <asp:TextBox ID="x_relay_response"      runat="server" Style="display: none;" Text="FALSE"></asp:TextBox>
        <asp:TextBox ID="x_delim_data"          runat="server" Style="display: none;" Text="TRUE"></asp:TextBox>

 and you are gauranteed to get back a delimited value set string. This is documented in the DPM implementation guide.

 

I was wondering about the parent window for the IFRAME - I'll check it out after reading the relay response checklist.

 

Thanks for the response!!

 

I appreciate it!

 

R

 

Contributor
Posts: 16
Registered: ‎08-18-2012

Re: DPM results capture.

[ Edited ]

Nope.

 

DPM simply does not work.

 

I've gone as far as :

1. building a new .Net 3.5 site where the submit and relay pages are all that exist in the site - no IFRAME

2. verified that the response page is available in the web by going to another BSD server of mine and calling fetch to get the page

3. copied the same url into the relay response field in the Authorize.net sandbox account

4. created a page posting winform application to simulate a post that proves that the page can be POST'ed to.

 

Below is my submission page and relay page.

 

See if you can get this to work. I say DPM is busted.

 

Submit:

 

<!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>

</title></head>
<body>
    <form name="form1" method="post" action="https://test.authorize.net/gateway/transact.dll" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMjA1ODg2NjkxN2RkF2wZa+5y0WuToXzI52q70DABFD4=" />
</div>

<div>

	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWKQKI8qW/BQKZn6DLCwKTufb1DgLN+4rMDAKM/trFAwL0yYqpAgLJn/hvAqzKsL8MApvktMMPAriS2JcOAsKRotULAvLj88MKAoa/hrUCAuncjqQHApWo1uABAt/yrIcNAvbh0MoDApqEisMFArCRxOIOAsvbtb0PAqL+tLoEAr2GlJkHApiIwYMOAueDufELAuLkg8kFAuDMxYIBAvHwsd0LAv2BldkHAvrjxrIDArSX6tYPAsT89LQGAp6Uz+EEApHZpYcMApvN6o4EAozntekEApu4nMkPAuGPm7kPAozbtswMAoT+ptQEAoGT+bULAoX7/u0FkBQnb2ysafyqvlPJdw+8NXJoAqc=" />
</div>
    <div>
        <input name="x_card_num" type="text" value="4222222222222" id="x_card_num" style="display: block;" />
        <input name="x_exp_date" type="text" value="1214" id="x_exp_date" style="display: block;" />
        <input name="x_card_code" type="text" value="234" id="x_card_code" style="display: block;" />
        <input name="x_tax" type="text" value="5.12" id="x_tax" style="display: block;" />
        <input name="x_amount" type="text" value="71.12" id="x_amount" style="display: block;" />
        <input name="x_cust_id" type="text" value="123" id="x_cust_id" style="display: block;" />
        <input name="x_first_name" type="text" value="Sally" id="x_first_name" style="display: block;" />
        <input name="x_last_name" type="text" value="Krimshaw" id="x_last_name" style="display: block;" />
        <input name="x_email" type="text" value="myemail@emailserver.com" id="x_email" style="display: block;" />
        <input name="x_phone" type="text" value="2485555555" id="x_phone" style="display: block;" />
        <input name="x_fax" type="text" id="x_fax" style="display: block;" />
        <input name="x_company" type="text" value="Bonk Company" id="x_company" style="display: block;" />
        <input name="x_address" type="text" value="123 Evergreen Cres." id="x_address" style="display: block;" />
        <input name="x_city" type="text" value="Emerald City" id="x_city" style="display: block;" />
        <input name="x_state" type="text" value="MI" id="x_state" style="display: block;" />
        <input name="x_zip" type="text" value="48009" id="x_zip" style="display: block;" />
        <input name="x_freight" type="text" value="Freight1&lt;|>regular&lt;|>0.0" id="x_freight" style="display: block;" />
        <input name="x_duty" type="text" value="Duty1&lt;|>export&lt;|>0.0" id="x_duty" style="display: block;" />
        <input name="x_tax_exempt" type="text" value="False" id="x_tax_exempt" style="display: block;" />
        <input name="x_po_num" type="text" id="x_po_num" style="display: block;" />
        <input name="x_ship_to_first_name" type="text" value="Sally" id="x_ship_to_first_name" style="display: block;" />
        <input name="x_ship_to_last_name" type="text" value="Krimshaw" id="x_ship_to_last_name" style="display: block;" />
        <input name="x_ship_to_address" type="text" value="123 Evergreen Cres." id="x_ship_to_address" style="display: block;" />
        <input name="x_ship_to_city" type="text" value="Emerald City" id="x_ship_to_city" style="display: block;" />
        <input name="x_ship_to_state" type="text" value="MI" id="x_ship_to_state" style="display: block;" />
        <input name="x_ship_to_zip" type="text" value="48009" id="x_ship_to_zip" style="display: block;" />
        <input name="x_login" type="text" value="MY_LOGIN" id="x_login" style="display: block;" />
        <input name="x_fp_sequence" type="text" value="2" id="x_fp_sequence" style="display: block;" />
        <input name="x_test_request" type="text" value="FALSE" id="x_test_request" style="display: block;" />
        <input name="x_fp_timestamp" type="text" value="1348931795" id="x_fp_timestamp" style="display: block;" />
        <input name="x_fp_hash" type="text" value="MY_HASH" id="x_fp_hash" style="display: block;" />
        <input name="x_relay_url" type="text" value="http://myserver/Booking/relay_response.aspx" id="x_relay_url" style="display: block;" />
        <input name="x_relay_response" type="text" value="TRUE" id="x_relay_response" style="display: block;" />
        <input name="x_delim_data" type="text" value="FALSE" id="x_delim_data" style="display: block;" />
        <input name="x_relay_always" type="text" value="TRUE" id="x_relay_always" style="display: block;" />
        <input name="x_version" type="text" value="3.1" id="x_version" style="display: block;" />
        <input name="x_method" type="text" value="CC" id="x_method" style="display: block;" />
        <input name="x_type" type="text" value="AUTH_CAPTURE" id="x_type" style="display: block;" />
        
        <input type="submit" name="btnGo" value="DON'T PANIC" id="btnGo" style="display: block;" />
        
    </div>
    </form>
</body>
</html>

 

Relay response page:

 

<%@ Page Language="C#" EnableViewStateMac="false" AutoEventWireup="true" CodeBehind="relay_response.aspx.cs" Inherits="SimpleADNTest.relay_response" %>

<!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>
        <asp:Label ID="Label1" runat="server" Text="Results"></asp:Label><br />
        <asp:Label ID="lblResult" runat="server" Text="..."></asp:Label><br />
        <asp:TextBox ID="x_response_reason_text" runat="server"></asp:TextBox>
    </div>
    </form>
</body>
</html>

 

Response page code behind:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace SimpleADNTest
{
    public partial class relay_response: System.Web.UI.Page
    {
        
        string result_cust_id = string.Empty;
        string result_response_code = string.Empty;
        string result_response_subcode = string.Empty;
        string result_response_reason_code = string.Empty;
        string result_response_reason_text = string.Empty;
        string result_auth_code = string.Empty;
        string result_invoice_num = string.Empty;
        string result_trans_id = string.Empty;
        string strEventID = string.Empty;
        string strRegID = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request != null && Request.Form != null && Request.Form.AllKeys != null)
            {
                if (Request.Form.AllKeys.Contains("x_response_code"))
                {
                    result_cust_id = Request.Form["x_cust_id"];
                    result_response_code = Request.Form["x_response_code"];
                    result_response_subcode = Request.Form["x_response_subcode"];
                    result_response_reason_code = Request.Form["x_response_reason_code"];
                    result_response_reason_text = Request.Form["x_response_reason_text"];
                    result_auth_code = Request.Form["x_auth_code"];
                    result_invoice_num = Request.Form["x_invoice_num"];
                    result_trans_id = Request.Form["x_trans_id"];

                }
            }
            lblResult.Text = "Unknown result";
            if (result_response_code != null && result_response_code.Length > 0)
            {
                int responseCode = 0;

                if (int.TryParse(result_response_code, out responseCode))
                {

                    switch (responseCode)
                    {
                        case 1:

                           
                            lblResult.Text = "Approved : Your reservation number is blaw blaw";
                            break;
                        case 2:
                            lblResult.Text = "Declined";
                            break;
                        case 3:
                            lblResult.Text = "Error";
                            break;
                        case 4:
                            lblResult.Text = "Held for review";
                            break;
                        default :
                            for (int i = 0; i < Request.Form.Count - 1; i++)
                            {
                                lblResult.Text += Request.Form.Keys[i] + " : " + Request.Form[i];
                                lblResult.Text += "<br />";
                            }
                            break;
                    }
                }
              
            }

        }
    }
}

 

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

Re: DPM results capture.

[ Edited ]

Just want to make sure, it the relay response URL accessible from the internet?

 

And you are still getting script timeout error?

Solution
Accepted by topic author rachmann
‎08-21-2015 01:58 AM
Expert
Posts: 4,525
Registered: ‎03-08-2010

Re: DPM results capture.

Using your relay response page. I found somthing interesting. When you use a id with the same name that is posting from authorize.net e.g. x_response_reason_text . it getting a script timeout, But if I change it, just by adding a 1 .e.g. x_response_reason_text1, it run fine. Not sure if it is a bug(or security feature?) on asp.net or authorize.net.

 

So the problem as the textbox with that id.

Contributor
Posts: 16
Registered: ‎08-18-2012

Re: DPM results capture.

WOW - I gotta try that - how'd you figure on trying that?

 

So you can't have any matching fileds from the post?