Finish button on checkout not redirecting

  • Posts: 84048
  • Thank you received: 13623
  • MODERATOR
11 years 3 months ago #149263

Then it probably means that the "force logout" option of your "hikashop group plugin" is turned off. Please check on that option via the joomla plugins manager.

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 3 months ago #149274

Force user logout on group update is set to Yes.

So to play around with it a bit I set it to No and saved it. Registered as a new user, paid, and was returned back to my website fine, but of course the user is logged in. Worked as expected.

I set it back to Yes. Registered as a new user, was redirected to Authorize.net payment page, submitted payment, and the Authorize.net thank you page is messed up, there is a script error (I think this is a script error).

Here's a screenshot of the error - Uncaught TypeError: Object (object global) has no method 'addEvent':



So when the Force user logout on group update is set to Yes in the Hikashop group plugin, the thank you page from Authorize.net is messed up but the user is logged out. When I set the Force user logout on group update to No, then the thank you page from Authorize.net is fine and the user is able to be redirected back to the site, but is of course is logged in.

Not sure what is causing the error and the thank you page looking weird. How can I fix this? Since it only happens when the Force user logout on group update is set to Yes, then I am assuming it's tied to the plugin somehow?

Attachments:

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

  • Posts: 84048
  • Thank you received: 13623
  • MODERATOR
11 years 3 months ago #149332

Yes. Could you turn on the debug mode and error reporting options of the Joomla configuration and try again ?
That should display an error message at the end of that page which will help us understand what's going on.

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 3 months ago #149361

I turned on debug mode and the error reporting and this is what I get when I register as a new user, then I'm directed to Authorize.net payment page, I submit payment, and this what I get for Authorize.net's thank you page now:



I am not sure if this is what you meant by turning on debug and error reporting. But I am getting the script error on the thank you page that is displayed after submitting payment with Authorize's payment form. So this is still with Authorize and the URL of secure.authorize.net/gateway/transact.dll , so it's not part of my Joomla site. I don't see any Joomla debug or error reporting for this page. Or am I doing this wrong? Is there another way to debug this error using Joomla's debug and error reporting even though it's on Authorize's page?

I only get the script error on Authorize's thank you page when Force user logout on group update is set to yes in the Hikashop group plugin.

Attachments:

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

  • Posts: 84048
  • Thank you received: 13623
  • MODERATOR
11 years 3 months ago #149377

Ok, the issue is that authorize.net is not able to handle the error display...
Let's do differently then.
Can you open your server's PHP error log file and look for the latest Fatal error message ? That should be that same error message that should be displayed on that error page.

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 3 months ago #149442

Looking at my error_log in my CPanel, I do not see any fatal error messages. The only thing that is in the error_log that is related to Hikashop and Authorize is this:

[24-Mar-2014 10:59:17 America/Denver] PHP Notice: Undefined property: stdClass::$order_addresses_fields in /home/public_html/media/com_hikashop/mail/order_creation_notification.text.php on line 78
[24-Mar-2014 10:59:17 America/Denver] PHP Warning: Invalid argument supplied for foreach() in /home/public_html/media/com_hikashop/mail/order_creation_notification.text.php on line 78
[24-Mar-2014 10:59:53 America/Denver] PHP Notice: Undefined variable: order in /home/public_html/plugins/hikashoppayment/authorize/authorize.php on line 417
[24-Mar-2014 10:59:53 America/Denver] PHP Notice: Trying to get property of non-object in /home/public_html/plugins/hikashoppayment/authorize/authorize.php on line 417
[24-Mar-2014 10:59:53 America/Denver] PHP Notice: Undefined index: in /home/public_html/plugins/hikashoppayment/authorize/authorize.php on line 417

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

  • Posts: 84048
  • Thank you received: 13623
  • MODERATOR
11 years 3 months ago #149528

Hi,

Can you change the code:

$body = str_replace('<br/>',"\r\n",JText::sprintf('PAYMENT_NOTIFICATION_STATUS','Authorize.net',$vars['payment_status'])).' '.JText::sprintf('ORDER_STATUS_CHANGED',$statuses[$order->order_status])."\r\n\r\n".$order_text;
to:
$body = str_replace('<br/>',"\r\n",JText::sprintf('PAYMENT_NOTIFICATION_STATUS','Authorize.net',$vars['payment_status'])).' '.JText::sprintf('ORDER_STATUS_CHANGED',$statuses[$order_status])."\r\n\r\n".$order_text;
in the file plugins/hikashoppayment/authorize/authorize.php and try again a payment like that ?

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 3 months ago #149575

No that did not work. Here's what I just noticed that might help. I have two types of users that will purchase using Hikashop - one is a new user that will register and then purchase membership and be put into the Paid Member with Continuing Education group after successful payment and the other is a user who is already a registered user/member and will login and renew their membership and also be put into the Paid Member with Continuing Education group.

For the user who is already registered but needs to renew membership, they can login to renew their membership and pay with Authorize.net - This works fine and the user is successfully redirect back to my site except that the user is not logged out even though I have Force user logout on group update. Their new group upon renewal of membership is Paid Member with Continuing Education. So they should be logged out to update their acl.

For the user who needs to register then pay with Authorize.net, the user registers, is directed to Authorize, submits payment and the thank you page for Authorize is what I posted earlier where my template is messed up. However with this user, they are in fact logged out at this time and they are put into the correct acl.

So two different users - one already registered and already logged in and pays and is redirected back to my site correctly but they are not logged out and the other is a new user who registers and is not correctly redirected back to my site but is logged out.

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 3 months ago #150003

More help and suggestions for getting my checkout to work properly will be greatly appreciated. Thank you!

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

  • Posts: 84048
  • Thank you received: 13623
  • MODERATOR
11 years 3 months ago #150028

The code modification I proposed is to remove the warning that you get in your logs. So you should not have that warning added to the log anymore.
For the fact that the user is not logged out, the only explanation I can see is that the user either is already in the correct group, or is a super admin and in that case we don't log him out as he already has enough rights.
For the fact that you get an error on authorize.net I would have guessed at a fatal error, but in that case you should see it in the log. So I'm a bit puzzled. Could you try maybe to change the "session handler" option of the joomla configuration. Maybe that would help avoid the issue.

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 3 months ago #150149

Thanks for the help. The users that I test with are not already part of the group nor are they super admins. Changing the session handler doesn't help.

How about this, I use to have code in the end file of the view checkout that would log out the user. That was what started this whole thread because after updating, that code in that file didn't work any more and just redirected the user to the home page and not to the payment page. If I turn off the Force user to logout on group update, then add code somewhere to some file to log out the user maybe that would work? What code could I use and where would I put it?

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 2 months ago #152972

Ok so I have since updated my Authorize.net payment plugin to use the AIM method. Now the Force user logout on group update plugin works. HOWEVER, with this option set to Yes, then the user is NOT redirected to the thank you page after purchase. I have tested this with having a Return URL in the Authorize.net payment plugin and without a URL in that field so that it uses the default thank you. The user is only directed to the home page, but they are finally logged out!

If I have the Force user logout on group update set to yes, then the user is directed back to the home page and is logged out. But they do not get a thank you page so it is kinda weird and the user will not realize their payment was processed successfully.

Please tell me how to force the redirection after purchase to the default thank you page or any URL that I put into the Return URL field in the Authorize.net payment plugin.

I response will be greatly appreciated as I would like to get this working correctly.

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 2 months ago #153314

Help on this will be greatly appreciated. Thank you.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 2 months ago #153437

Hi,

With the authorize payment method the customer should be redirect to the thank you page of the plugin.
plugins/hikashoppayment/authorize/authorize_thankyou.php".

Thanks to try to see if this is displayed by using custom code inside.
If it's the displayed page, so you can add a php redirect in order to reach the desired page.

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 2 months ago #153464

Thank you for your reply.

Could you please be more specific. I am not sure what custom code I need add to that file to see if I can get a thank you page to display. I googled how to do a php redirect and tried to put this:

<?php
/* Redirect browser */
header("Location: theos.in/ ");
/* Make sure that code below does not get executed when we redirect. */
exit;
?>

at the beginning of the file authorize_thankyou.php but that did not work.

Please let me know what custom code to add to that file to try to do a redirect to auto.com/index.php/registrationredirect

Thank you.

Last edit: 10 years 8 months ago by dbarnhart863.

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

  • Posts: 12953
  • Thank you received: 1778
11 years 2 months ago #153559

Hello,
The solution will probably be to use that kind of custom code :

<?php
$link = "www.MYSITE.com";
$app = JFactory::getApplication();
$app->redirect($link);
?>
Note that you'll have to replace www.MYSITE.com by your redirection link.

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 2 months ago #153583

Thank you Mohamed. No that did not work. Just so that I had this right: I put that code in the file authorize_thankyou.php. On testing, I am still just redirected back to the home page.

What else to try?

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

  • Posts: 54
  • Thank you received: 3
  • Hikashop Business
11 years 2 months ago #153597

OK I have it working ok. Not sure if this is working correctly according to how it 'should' work but here is what I did:

Since I have switched to using the AIM method of authorize, I added the code to force the user to log out after checkout. I put

<?php
$this->after_end();
$app = JFactory::getApplication();
$app->logout( $this->order->customer->user_cms_id );
?>

in the file after_end in the view checkout.

I kept the Force user logout on group update to No under the Hikashop group plugin. I am using the default Hikashop thank you page so there is not a redirect URL in my Authorize.net plugin.

Now it works with both a user who is logged in and renewing their registration or a new user who is purchasing for the first time. After the user finishes and pays they are directed to Hikashop's thank you page and then automatically (after about a couple seconds) redirected to the home page and they are logged out.

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

Time to create page: 0.104 seconds
Powered by Kunena Forum
loading