- Posts: 332
- Thank you received: 6
Authorize not returning to site directly
- LukeDouglas
-
Topic Author
- Offline
-- 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?
Please Log in or Create an account to join the conversation.
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').'';
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.
- LukeDouglas
-
Topic Author
- Offline
- Posts: 332
- Thank you received: 6
| Hikashop Authorize Payment Plugin - Return url | Authorize Default Relay Response URL | Transaction Result |
| www.divorcetoolbox.net/thank-you-for-your-purchase | No entry | Get page with link to return to website |
| www.divorcetoolbox.net/index.php?option=...&view=article&id=283 ] | No entry | Get 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-purchase | Can'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.
Please Log in or Create an account to join the conversation.
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.
- LukeDouglas
-
Topic Author
- Offline
- Posts: 332
- Thank you received: 6
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.
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.
- LukeDouglas
-
Topic Author
- Offline
- Posts: 332
- Thank you received: 6
First I commended out the following code in that file as follows:
Then I just completely removed it with and without the 'if' statement as follows:
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'.
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:
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.
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:
Whooppeeeeee! :woohoo: :woohoo: :woohoo: :woohoo: :woohoo: :woohoo:
Please Log in or Create an account to join the conversation.