Skip to main content

Paypal Pro Payments redirection

More
12 years 3 months ago - 12 years 3 months ago #161757 by Scott
-- HikaShop version -- : latest version
-- Joomla version -- : latest version

I'm using Paypal Pro to process credit card payments on my site. However, I'm having problems with redirection after payment. Using Paypal Pro, its all processed in the background so the user is never taken to Paypals site. After clicking finish on the shopping cart, the payment is processed and your immediately redirected to "Thank you for your purchase."

I'd like to redirect the page to my own custom thank you page.

I've searched this on the forum and the solutions don't appear to work for me. Firstly, the return URL setting in the Paypal Pro plug-in doesn't work. I entered an address and it was completely ignored and just went to the standard "Thank you for your purchase."

I then tried editing the "after_end" code to the following:
Code:
<?php defined('_JEXEC') or die('Restricted access'); ?><?php $doc =& JFactory::getDocument(); $doc->addScriptDeclaration("window.addEvent('domready', function() {window.location='http://**********************/index.php?option=com_content&view=article&id=159:payment-success&catid=78:main-content&Itemid=639'});"); ?>

That doesn't work either, it still redirects to the same "Thank you for your purchase.". I suspect that I may have to edit the paypalpro_thanks.php but I'm not sure what edits I need to make or where to put them in this file:
Code:
<?php /** * @package HikaShop for Joomla! * @version 2.3.0 * @author hikashop.com * @copyright (C) 2010-2014 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?><div class="hikashop_paypalpro_thankyou" id="hikashop_paypalpro_thankyou"> <span id="hikashop_paypalpro_thankyou_message" class="hikashop_paypalpro_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)){ $doc = JFactory::getDocument(); $doc->addScriptDeclaration("window.addEvent('domready', function() {window.location='".$this->payment_params->return_url."'});"); }

I'm not a programmer so could you keep it simple for me please :)

Also, is it possible to include the order details in my new joomla thank you page?

Thanks in advance for any help
Last edit: 12 years 3 months ago by Scott.

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

More
12 years 3 months ago #161965 by nicolas
Hi,

Normally, there is no code to change. You just need to enter your URL in the "return URL" option of the plugin and it will do the redirection automatically.

If that doesn't work, it means that there must be a javascript error on the page. Adding other custom javascript in the view won't help in that case since the javascript error will still be there.
You have two ways to go about it:
- You look at the javascript error via your browser's error console and you see if you can fix it. But it might be quite complex to do.
- You add custom PHP code for the redirect in that file:
Code:
$app =JFactory::getApplication(); $app->redirect('http://**********************/index.php?option=com_content&view=article&id=159:payment-success&catid=78:main-content&Itemid=639');

But if you want to include the details of the order, I would recommend to simply redirect to the order details page:
Code:
$app =JFactory::getApplication(); $app->redirect('http://**********************/index.php?option=com_hikashop&ctrl=order&task=show&order_id='.$app->getUserState('com_hikashop.order_id'));
The following user(s) said Thank You: Scott

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

More
12 years 3 months ago - 12 years 3 months ago #161967 by Scott
Thank you for the reply Nicolas.

Do I need to apply that code in the paypalpro_thanks.php?

If so, whereabouts would I place it? (Sorry, I'm not a good programmer)

Thanks again.
Last edit: 12 years 3 months ago by Scott.

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

More
12 years 3 months ago #162023 by nicolas
Yes, in that same file.
You can place it just after the first line where there is the <?php opening tag.
The following user(s) said Thank You: Scott

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

Time to create page: 0.179 seconds
Powered by Kunena Forum