I am using relay response to get transaction results to my custom receipt.php page. My relay.php page smoothly transitions to my receipt.php page. However, I see no transaction data on my receipt.php page.
I'm just not finding an instruction either in the guides or on the forum that gives me what I need. I've spent long hours searching. I've also looked in the php sdk.
Right now, I have code on my relay.php file. The code processes the transaction data that's coming from authorize.net. I know this code is working because some of the transaction data goes into a db.
On my relay.php page, I had the redirect code in the head section. I moved the redirect code to the bottom of the page, but that did not help.
Right now, my relay.php file is a complete php page. I have no code whatsover in my receipt.php page. I did it this way because I thought the code from the relay.php file would be forwarded to the receipt.php page. But I see only a blank page on the receipt.php page. I get a blank page if I go directly to the receipt.php page, and I get a blank page if I go directly to relay.php (which redirects me to receipt.php).
Is there anything I can do?
05-17-2015 12:51 PM
I did it this way because I thought the code from the relay.php file would be forwarded to the receipt.php page.
are you using a javascript redirect? it two different page, no code will be forwarded.
05-17-2015 01:31 PM
Thank you.
Yes, it is a javascript redirect.
Maybe I'm misunderstanding the purpose of the relay response. It is designed to get transaction data to a receipt page on the merchant's server? If that is correct, what am I doing wrong? Is there anything at this link that would help?
http://stackoverflow.com/questions/3045097/php-redirect-and-send-data-via-post
05-17-2015 02:10 PM
a javascript only change the url location on a web broswer, like when you type it something.
it doesn't transfer any data other then what on the url.
05-17-2015 04:14 PM
Thank you.
Based on what you said, I went looking for a method to get the data to the receipt page, and I found one on stack overflow, but I'm not going to use it because it is dependent on javascript. I don't think everyone has javascript enabled. Here is the code in my relay.php page that made it work (only one post item in this code snippet):
<form action='http://site.com/receipt.php' method='post' name='frm'>
<?php
$first = $_POST['x_first_name']; // This post item is coming from authorize.net
echo "<input type='hidden' name='x_first_name' value='$first'>"; // This post item is headed for receipt.php
?>
</form>
<script>
document.frm.submit();
</script>
Here's the code that I placed in my receipt.php page:
<?php
$first = $_POST['x_first_name'];
echo "$first";
?>
Instead of using relay response and the above code, I've decided to use the hosted receipt. It's working well and is not dependent on javascript.
My hosted receipt process goes like this:
Page A (on my server) > Page B (on my server) > authorize.net > hosted receipt.
In my hosted receipt process, I am using a silent post page. My purpose is to have the transaction data sent to the silent post page and then have the silent post page insert some of the transaction data into a db.
Is there any reason why I should not use the silent post in this procedure?
05-17-2015 06:42 PM