Authorize not returning to site directly

  • Posts: 332
  • Thank you received: 6
8 years 1 month ago #251404

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.2
-- PHP version -- : 5.5.43
-- Browser(s) name and version -- : FF, Chrome, Edge - all current

I've been working with Authorize.net personnel to try and get an automatic return back to the site without the viewer having to click a link at a page that displays this:


Thank you for your purchase. Please click below to get access to the programs.
Go to my account

You can go back to the shop by clicking on this link
The return link in the payment plugin is this:

www.divorcetoolbox.net/thank-you-for-your-purchase

The post URL is this:

"return_url": "https:\/\/www.divorcetoolbox.net\/thank-you-for-your-purchase",

The Authorize.net tech stated:

Greetings Luke,

Thank you for your reply. I'm happy to assist you further.

You need to make sure that the URL that you're using is valid. When I try to go to https:\/\/www.divorcetoolbox.net\/thank-you-for-your-purchase, it gives me an invalid message.


When I paste https:\/\/www.divorcetoolbox.net\/thank-you-for-your-purchase into Chrome, FF or IE, it changes the link to www.divorcetoolbox.net//thank-you-for-your-purchase and the page is displayed. It does not work in Safari. I get an error:

Safari can't find the server.
Safari can't open the page "https://%5C/%5C/www.divorcetoolbox.net%5C/thank-you-for-your-purchase". because Safari can't find the server "\".


What is the purpose of having the "\" as an escape character in a simple URL? How can I get this to work if Authorize indicates it is not a valid URL when it is a valid URL in the plug-in field?

Last edit: 8 years 1 month ago by LukeDouglas.

Please Log in or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #251432

Hi,

The redirect page is sent to authorize.net by HikaShop with the file plugins/hikashoppayment/authorize/authorize_thankyou.php
There, the link is done like that:
echo '<br/><a href="'.$this->payment_params->return_url.'">'.JText::_('GO_BACK_TO_SHOP').'</a>';
I invite you to replace that line by:
echo '<br/><a href=" www.divorcetoolbox.net/thank-you-for-your-purchase ">'.JText::_('GO_BACK_TO_SHOP').'</a>';

And you should still have the same error because HikaShop doesn't have these \ characters to the return url as far as I can see in the code.
So that means that these characters would be added either by your server, or by a plugin on your website, or by authorize.net

Please Log in or Create an account to join the conversation.

  • Posts: 332
  • Thank you received: 6
8 years 1 month ago #251604

I have tried the following combinations with no luck:

Hikashop Authorize Payment Plugin - Return urlAuthorize Default Relay Response URLTransaction Result
www.divorcetoolbox.net/thank-you-for-your-purchase No entryGet page with link to return to website
www.divorcetoolbox.net/index.php?option=...&view=article&id=283 ]No entryGet page with link to return to website
No entry www.divorcetoolbox.net/thank-you-for-your-purchase (14) The referrer, relay response or receipt link URL is invalid
No entry www.divorcetoolbox.net/index.php?option=...&view=article&id=283 ](14) The referrer, relay response or receipt link URL is invalid
www.divorcetoolbox.net/thank-you-for-your-purchase www.divorcetoolbox.net/thank-you-for-your-purchase (14) The referrer, relay response or receipt link URL is invalid
www.divorcetoolbox.net/index.php?option=...&view=article&id=283 ] www.divorcetoolbox.net/index.php?option=...&view=article&id=283 ](14) The referrer, relay response or receipt link URL is invalid
https:\/\/www.divorcetoolbox.net\/thank-you-for-your-purchaseCan't enter this URL - not accepted - so I leave it blank(14) The referrer, relay response or receipt link URL is invalid

At this point, I do not think it is possible to try anything else. Either this feature is simply not working, which may not be HikaShop issue but issue with Authorize, or Authorize is not recognizing what I am entering.

Last edit: 8 years 1 month ago by LukeDouglas.

Please Log in or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #251639

Hi,

What you're saying is normal. The Relay response URL should be left empty in the Authorize.net merchant account.
And it's normal that you get the page with the return URL to go to the website in the other cases as that's what it is supposed to do.

So I don't understand why you say it's not working. Having the link to go back to the website after the payment is what you're supposed to have no ? What else do you want ?
I thought that your problem was with something escaping the special characters in the return URL, no ? I don't see why you think the tests you made are linked to solving that issue ?
How about the modification I proposed ? Did it change anything ?

Please Log in or Create an account to join the conversation.

  • Posts: 332
  • Thank you received: 6
8 years 1 month ago #251711

Nicolas,

I 'now' agree with your statement. Authorize displaying the page with the link to return back to the website is the default functionality of their system. I was just trying to get it to return automatically back to the clients website without having to click the link. Oh well....we'll live with it. :woohoo:

Please Log in or Create an account to join the conversation.

  • Posts: 82864
  • Thank you received: 13372
  • MODERATOR
8 years 1 month ago #251762

Hi,

Ok. So regarding that, try removing the lines:
<!--[if IE]>
and:
<![endif]-->
in the file plugins/hikashoppayment/authorize/authorize_thankyou.php
That should help having it redirect automatically.

Please Log in or Create an account to join the conversation.

  • Posts: 332
  • Thank you received: 6
8 years 1 month ago #251809

Nicholas,

First I commended out the following code in that file as follows:

<?php if(!empty($this->payment_params->return_url)){ ?>
<?php /* commenting out this section as per Nicolas at HikaShop to see if we can get an automatic return from Authorize.net
<!--[if IE]>
<script type="text/javascript">
	window.location='<?php echo $this->payment_params->return_url; ?>';
</script>
<![endif]--> */ ?>
<?php } ?>

Then I just completely removed it with and without the 'if' statement as follows:
<?php if(!empty($this->payment_params->return_url)){ ?>
<?php } ?>

No luck! I get pretty much the same type of responses in testing. If I have the "h t t p s://www.divorcetoolbox.net/thank-you-for-your-purchase" URL in the Authorize.net Default Relay Response URL and/or even the Default Receipt URL, I get this error whether or not I have the same URL in the Hikashop Authorize payment plugin 'Return url'.
The following errors have occurred.
(14) The referrer, relay response or receipt link URL is invalid.

If I have NO URL in the Authorize.net settings, I get the page to click to return back to the website.

Thank you for your purchase. Please click below to get access to the programs.
Go to my account

You can go back to the shop by clicking on this link


When I stop the checkout and check the code, the 'x_relay_url' that Authorize.net is checking is as follows:
<input name="x_relay_url" value="https://www.divorcetoolbox.net/index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=authorize&tmpl=component&lang=en&Itemid=356" type="hidden">

I would have been expecting the "h t t p s://www.divorcetoolbox.net/thank-you-for-your-purchase" to be in that field.

So on a hunch, I decided to put the following link into each of the Authorize.net URL settings (one at a time and tested) so it matched up with the "x_relay_url" settings.
https://www.divorcetoolbox.net/index.php?option=com_hikashop&ctrl=checkout&task=notify&notif_payment=authorize&tmpl=component&lang=en&Itemid=356

I did not get the Error #14 display. It went to the Authorize.net site, I submitted the payment and got the 'return link page' which if I clicked the link, it returned back to the page I wanted it to return which is the setting in the HikaShop Authorize payment plugin. So that procedure didn't work either.

At this point, I couldn't think of a single other way I could have tested this process.

BUT THEN, I had a light bulb go off. I edited the thank you page to just directly do this via HTML and it works!!!!

Here is the code:
<?php
/**
 * @package	HikaShop for Joomla!
 * @version	2.6.3
 * @author	hikashop.com
 * @copyright	(C) 2010-2016 HIKARI SOFTWARE. All rights reserved.
 * @license	GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
?>
<?php /* bypassing and putting in automatic return via HTML javascript
<div class="hikashop_authorize_thankyou" id="hikashop_authorize_thankyou">
	<span id="hikashop_authorize_thankyou_message" class="hikashop_authorize_thankyou_message">
		<?php echo JText::_('THANK_YOU_FOR_PURCHASE');
		if(!empty($this->payment_params->return_url)){
			echo '<br/><a href="'.$this->payment_params->return_url.'">'.JText::_('GO_BACK_TO_SHOP').'</a>';
		}?>
	</span>
</div>
<?php if(!empty($this->payment_params->return_url)){ ?>
<!--[if IE]>
<script type="text/javascript">
	window.location='<?php echo $this->payment_params->return_url; ?>';
</script>
<![endif]-->
<?php } ?>
*/ ?>
<!doctype html>
 
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Authorize Redirect Page</title>
    <meta name="description" content="A page that will redirect the user to the DivorceToolbox.net thank you page after 1 second">
    <meta name="author" content="DivorceToolbox.net">
    <meta http-equiv="refresh" content="1;URL=https://www.divorcetoolbox.net/thank-you-for-your-purchase">
  </head>
 
  <body bgcolor="#ffffff">
    <center>If you are not automatically redirected to the thank you page after 3 seconds, please <a href="https://www.divorcetoolbox.net/thank-you-for-your-purchase">CLICK HERE</a></center>
  </body>
</html>

Whooppeeeeee! :woohoo: :woohoo: :woohoo: :woohoo: :woohoo: :woohoo:

Last edit: 8 years 1 month ago by LukeDouglas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.092 seconds
Powered by Kunena Forum