cancel
Showing results for 
Search instead for 
Did you mean: 

Payment page returns error, but payment data arrives at our server (wpStoreCart)

Hi.

 

We use WordPress and wpStoreCart - a shopping cart solution that has an API that works with authorize.net.

 

Not sure if anyone here knows about wpStoreCart - one other issue is that American Express payments do not seem to work at all, but that's not why I'm writing here today.

 

The issue is that the cart is passing invoice information to https://secure.authorize.net/gateway/transact.dll.

I enter a credit card, and then I receive this message:

 

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.

 

The email contains this error:

 

Your script timed out while we were trying to post transaction results to it. 

 

Now the interesting thing is that our server logs clearly show that the payment information is received by us. We get the approval code, card type, last 4 digits, etc.

However, authorize.net still throws an error message.

 

The data that is submitted to the payment gateway includes x_relay_url and the correct URL to our server - and obviously, that is working since we do receive the payments.

 

When I access that url myself, the server responds (by default with an empty page, but I changed that - see later).

 

During 3 long chats with support, I was given the following information:

 

https://support.authorize.net/authkb/index?page=content&id=A663

which includes a list of troubleshooting steps. I tried all of them and couldn't find anything wrong.

 

The next person gave me this:

 

To begin troubleshooting an error 52 (time out error) please review the following information from our help files: 
-Before doing anything else, have your script start writing to your receipt page. For example: Print your page headers and the first part of the page body. If your script prints to the screen first, we recognize that you and your customer have received the transaction results. 
-Check that your script permissions are correct and that it can accept an HTTPS POST. 
-Check that the script is not completing other functions before writing to the screen such as writing to a database or sending e-mails. 
-Please check to see if there are different processes that are used in your script for approvals, declines, or errors. Check each process to be sure that they write to the screen before any other functions. 
-Verify that your script is not using redirects upon receiving the response from our servers. Redirects are strongly discouraged because they can potentially interfere with the process.

 

The development site says this:

 

if the merchant’s web server does not send a positive response after ten seconds, then the connection will time-out

 

So I'm figuring there's something that their server expects from ours since all is working on our end.

 

So I started following the steps and created an HTML header first thing before anything else happens and throw it out on the page. That works when I open the page directly in a browser.

 

Still nothing...

 

My system is running PHP, but even developers who use other languages might be able to help here.

 

All I basically need to know:

 

What does their server expect as a correct response in order to not call the connection a timeout?

 

Thanks in advance!

 

 

 
rlund
Contributor
18 REPLIES 18

Ah, guess what, the site is NOT sending a 200 - it is sending a 500, but without any visible notice - I had to set cURL to verbose mode to find this!

I hadn't seen any error messages in the server logs so I never even looked at this...

 

So thanks for pointing this out, or I would never have found this! :-)

I found the 500 error, and it's an issue with wpStoreCart that I can't easily diagnose or fix (and the site doesn't out put a php error log for some reason), but at least I have something to go on now (I'll try updating the software, then we'll see).

 

In any case, thanks so much for pointing out the 200 message - I would never have tested for this otherwise :-)

 

This thread mentioned that authorize.net was not getting anything back from the merchant's site. I think I am having that problem. 

 

When i click "Submit Payment" on my custom checkout page, the url I see becomes the secure authorize.net site. The page is mostly blank except that one word (hello) that I have in my relay/response page is there.

 

So it looks like authorize.net is finding my relay/response page ok, but the receipt page is not sending back anything to authorize.net. Or, maybe the relay/response page is never redirecting to the receipt page.

 

Here is the code in my relay/response page:

 

<?php
if ($_SERVER["SERVER_PORT"] != 443)
{
header('Location: https://www.site/relay.php');
}
?>
<html>
<head>

<script type=”text/javascript” charset”utf-8”>
window.location='https://www.site.com/receipt.php';
</script>
<noscript>
<meta http-equiv=”refresh” content=”1;url=https://
www.site/receipt.php”>
</noscript>

</head>
<body>
<p>hello!</p>
</body>
</html>

 

Here is the code in my receipt page:

 

<?php
if ($_SERVER["SERVER_PORT"] != 443)
{
header('Location: https://www.site/receipt.php');
}
?>
<?php
if ($_SERVER["SERVER_PORT"] != 443)
{
header('Location: https://www.site/receipt.php');
}
?>
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php
$card=$_REQUEST['x_card_num'];
echo"$card and hello";
?>
</body>
</html>

 

The receipt.php does work. I see "and hello" when I go there directly.

 

What can I do to get my receipt.php page to send something back to authorize.net?

 

Or, if the relay/response page is not redirecting to receipt.php, what can I do about that?

 

All of the my ttansactions are successful, but I never see the receipt page (I'm using sandbox, but I was using secure authorize.net, and I got the same behavior there),

 

I have tried removing the SSL coding, but that doesn't help.

 

Thank you. 

 

 

r2d2
Contributor

The receipt.php does work. I see "and hello" when I go there directly.

 

what about your relay.php what do you see If you go there directly?

I see "hello!" when I go to relay.php directly. This is the same as I get when I complete a transaction, but the url at the top of that page is the secure authorize.net url.

If you only see hello when you go to relay.php directly, that look to me your redirect is not working.

 

Can you see what is the page source on the web browser when you go to relay.php directly?

I looked at the relay.php page source, as you suggested. There were some quotation marks that looked odd, so I removed those and put in some regular quotation marks. As soon as I did that, relay.php redirected me to the receipt.php page.

 

I had copied and pasted the code in relay.php from authorize.net, so I'm pretty sure other people could have this problem.

 

I am very grateful for you suggestion (source code) because I  had spent hours trying to resolve this problem. I can't thank you enough!

 

So, I got that problem fixed, but that revealed another problem. I thought I was going to be able collect data from my shopping cart on my receipt.php page. However, I've been unable to do that. I noticed you discussed this problem with someone else, but I think that person may have been using .asp pages. I'm using php. Here is the link to that other discussion: https://community.developer.authorize.net/t5/Integration-and-Testing/Questions-about-DPM-relay-page-...

 

You advised that person to insert the shopping cart data into a db while on the relay.php page, and then use a key to recall it on the receipt.php page. I hope I have that right. 

 

Because I'm using php, couldn't I create session variables on the relay.php page and then echo the session variables on the receipt.php page? I know session variables may not be that secure, but the data I want to echo on the receipt.php page is not that sensitive. 

 

Because I'm using php, couldn't I create session variables on the relay.php page and then echo the session variables on the receipt.php page? I know session variables may not be that secure, but the data I want to echo on the receipt.php page is not that sensitive.

 

Don't know if that will work or not, because the site that display the relay.php is authorize.net and not your site, and session don't go across website. But you can try and see if it works or not.

Session cookies do not work.

 

I have decided not to have the relay page. Instead, I am having the hosted gateway receipt. That's a nice receipt, and it has a link back to my site, and I can still use my custom shopping cart. When I click "Pay Now" in the shopping cart, I get the receipt from authorize.net. Very nice.

 

<input type='hidden' name='x_receipt_link_method' value='LINK' />
<input type='hidden' name='x_receipt_link_text' value='Click here to return
to the Site home page' />
<input type='hidden' name='x_receipt_link_URL' value='http://site.com/' />

 

I hope this works as well in the secure authorize.net site as it does in sandbox.

 

Thank you for taking the time to get me through this! I will give you some kudos.