cancel
Showing results for 
Search instead for 
Did you mean: 

One instance of relay response (SIM) works perfectly, while the other fails

Hello All,

 

I am having a problem integrating an online payment utilizing relay response. This problem is especially perplexing, as we have one instance working properly, and one is not - on the same web site. I've brought this to customer support, and after validating all of their credentials on using this type of system.  They simply told me they can't help me and pointed me here. So, I'm hoping that someone has had a similar problem, and can guide me in the right direction.

 

For the one that works, we have the following code setup on the entry button:

 

<form name="AuthForm" method="post" action="https://secure.authorize.net/gateway/transact.dll" id="AuthForm">
<input type='hidden' name="x_relay_response" value="true" />
<input type='hidden' name="x_relay_url" value="VALID RETURN URL" />
</form>

 

I've omitted hidden fields that aren't relevant, of course. This system works as expected. After a credit card payment is entered, the user is redirected back to the response page, where our script processes the payment information as needed.


We are trying to create a second access point to the hosted payment form. We're using the same transaction key, account, and even the same scripting to create the form. Here is what's passed:

 

<form name="AuthForm" method="post" action="https://secure.authorize.net/gateway/transact.dll" id="AuthForm">
<input type='hidden' name="x_relay_response" value="true" />
<input type='hidden' name="x_relay_url" value="SECOND VALID URL" />
</form>

 

Once the user clicks the button, they are, as expected, taken to the hosted payment form. However, once the payment is entered, the user is presented with this information:

 

"An error occurred while trying to report this transaction to the merchant. An e-mail has been sent to the merchant informing them of the error. The following is the result of the attempt to charge your credit card.

 

This transaction has been approved.


It is advisable for you to contact the merchant to verify that you will receive the product or service."

 

After some research, and communication with support, it looked as if this error was due to Authorize.net not being able to communicate with the response page. That perhaps there were errors on the page, or it wasn't accessable at all. To simplify testing, we created a response page that was a simple "Thank You". The new page clearly loaded correctly, and simply displays the message. Now, the payment is processed correctly, but the consumer sees this message, and of course any processing that needs to happen on the response page will not happen.

 

Again, what's perplexing is that the first instance using relay response ALWAYS works, and the second one ALWAYS does not. They both use the same account, and utilize the same web hosting account. I've even tried using different programming languages - all with the same result. All return URLs areI am at a loss as to how to proceed. Any assistance you could provide would help tremendously.

creative1
Member
5 REPLIES 5

If the first url always, work and the second always fail. There is something different about the second url.

How about delete any code for the second url, then make a copy of the first one and rename it to the second.

RaynorC1emen7
Expert

Thanks for the reply, but it's a fully valid URL.  I didn't post it for security reasons, but it's simply a page that writes "Thank You". Instantly accessible, and no issues whatsoever.

Can you post the relay response page and code. When you said fully valid URL,it that mean it can access from outside without any issue(SSL, etc)?

https://myaccount.superiorplusenergy.com/onetimepay/onetimepay-response.html

 

code:

 


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

Thank You

</body>

</html>

Look like you are using asp.net

 

test code

string post_string = "test=xyz";
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create("https://myaccount.superiorplusenergy.com/onetimepay/onetimepay-response.html");
objRequest.Method = "POST";
objRequest.ContentLength = post_string.Length;
objRequest.ContentType = "application/x-www-form-urlencoded";

// post data is sent as a stream
StreamWriter myWriter = new StreamWriter(objRequest.GetRequestStream());
myWriter.Write(post_string);
myWriter.Close();

// returned values are returned as a stream, then read into a string
string post_response;
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse();
using (StreamReader responseStream = new StreamReader(objResponse.GetResponseStream()))
{
	post_response = responseStream.ReadToEnd();
	responseStream.Close();
}

 Getting Error 405 - The remote server returned an error: (405) Method Not Allowed.

 

If you are using asp.net, might need to set

<asp:Page EnableViewStateMac="False" />