Reply
Highlighted
Contributor
Posts: 30
Registered: ‎05-08-2014

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

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

Highlighted
Contributor
Posts: 30
Registered: ‎05-08-2014

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

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 :-)

 

Highlighted
Contributor
Posts: 11
Registered: ‎05-02-2015

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

[ Edited ]

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. 

 

 

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

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

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?

Highlighted
Contributor
Posts: 11
Registered: ‎05-02-2015

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

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.

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

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

[ Edited ]

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?

Highlighted
Contributor
Posts: 11
Registered: ‎05-02-2015

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

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. 

 

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

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

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.

Highlighted
Contributor
Posts: 11
Registered: ‎05-02-2015

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

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.