Jump to content

1.6.0.6 Paypal Payment Return


tdr170

Recommended Posts

This is a new one and I can not seem to find the answer, I have a 1.6.0.6 test site that is upgraded from 1.5.6.1 and all works well with the exception of Paypal.

After placing an order When Paypal returns you to the site you get a 404 page error and it seems as though Paypal is trying to return to the old confirmation.php file that used to be in the root folder.

If you copy the confirmation.php file to the root then it will return to the order confirmation page but is slightly wrong as I have the left column displayed on all pages and when it returns the left column  does not display and their are 2 Oder confirmation nav pipes.

As you can see the 404 keeps the left column as it should and with the order-confirmation.php copied to the root left column not shown.

Everything else about the order is OK mails are sent, order shows in BO, upon changing order status mails are sent.

 

Has anyone seen this issue.

 

Standard return.

post-310220-0-17879600-1397587624_thumb.jpg

 

 

W/ order-confirmation.php copied to root.

post-310220-0-89182800-1397587681_thumb.jpg

 

If you click back to orders you see this which is correct.

post-310220-0-44447700-1397588102_thumb.jpg

Edited by tdr170 (see edit history)
Link to comment
Share on other sites

Here is a solution that I found myself this will at least return you to the site without a 404 page not found issue.

This is for PayPal USA, Canada V1.3.3

In this case I changed the code to return to the order-history page instead the order-confirmation because in my case this shows the left column.

 

You can also test this - controller=order-confirmation   instead of      controller=order-history

 

Lines - 378-381

 

change this:

((int)version_compare(_PS_VERSION_, '1.6' )) ?
(Configuration::get('PS_SSL_ENABLED') ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true)).
__PS_BASE_URI__.'index.php?order-confirmation.php?id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->id.'&key='.$this->context->customer->secure_key : 
$this->context->link->getPageLink('index.php?order-confirmation.php', null, null, array('id_cart' => (int)$this->context->cart->id, 'key' => $this->context->customer->secure_key, 'id_module' => $this->id)),
 

 

 

to this

((int)version_compare(_PS_VERSION_, '1.6' )) ?
(Configuration::get('PS_SSL_ENABLED') ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true)).
__PS_BASE_URI__.'index.php?controller=order-history?id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->id.'&key='.$this->context->customer->secure_key : 
$this->context->link->getPageLink('index.php?controller=order-history', null, null, array('id_cart' => (int)$this->context->cart->id, 'key' => $this->context->customer->secure_key, 'id_module' => $this->id)),
 
 
 
See my next post
Edited by tdr170 (see edit history)
Link to comment
Share on other sites

This is for PayPal USA, Canada V1.3.3

 

OK so I think I found a way to fix this even better solution, first go to SEO & URL's and you will see that there is no friendly url for Order confirmation.

Click the plus sign to add new page and use the drop down and select

order-confirmation

then add

Page title: Order confirmation

Rewritten URL: order-confirmation

 

Now edit the paypal.php file and change lines as below  -  modules, paypalusa at lines 378-381 

 

change this:

((int)version_compare(_PS_VERSION_, '1.4', '>')) ?
(Configuration::get('PS_SSL_ENABLED') ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true)).
__PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->id.'&key='.$this->context->customer->secure_key : 
$this->context->link->getPageLink('order-confirmation.php', null, null, array('id_cart' => (int)$this->context->cart->id, 'key' => $this->context->customer->secure_key, 'id_module' => $this->id)),
 
));

 

 

 

To this:

((int)version_compare(_PS_VERSION_, '1.4', '>')) ?
(Configuration::get('PS_SSL_ENABLED') ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true)).
__PS_BASE_URI__.'order-confirmation?id_cart='.(int)$this->context->cart->id.'&id_module='.(int)$this->id.'&key='.$this->context->customer->secure_key : 
$this->context->link->getPageLink('order-confirmation', null, null, array('id_cart' => (int)$this->context->cart->id, 'key' => $this->context->customer->secure_key, 'id_module' => $this->id)),
 
));
 
 
Now we need to edit one file so that there are not 2 nav pipes (breadcrumbs) on the page, go to themes, default-bootstrap and edit order-confirmation.tpl and remove {include file="$tpl_dir./breadcrumb.tpl"} from line 27.
 
 
Now on order return you should see a normal page return mine now looks like this.
 
post-310220-0-29875800-1397925275_thumb.jpg
 

 

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

The only way I have found with this version is to edit the PHP, you can also use PayPal module 3.6.8 which does not require any editing.

If you do not have this module in your list I can include a zip file of it here.

  • Like 1
Link to comment
Share on other sites

Here is a zip of V3.6.8 give it a try.

 

attachicon.gifPayPal v3.6.8.zip

 

Where exactly does this go? in /modules/ or my root? Oddly enough I don't have this folder, just one called modules/paypalusa/. The files do not match anything I have either.

 

I installed fresh and didn't upgrade so that may have something to do with it.

 

Link to comment
Share on other sites

You can install this as you would any other module, go to the modules page and use add new module browse to location on your computer where you saved and click upload. Before installing be sure and uninstall the PaypalUSA version.

If you upload the unzipped folder it should be placed in the modules folder.

  • Like 1
Link to comment
Share on other sites

Ah, sorry I was confused. I didn't realize this is the paypal europe module, I thought you were editing the paypalusa module.

 

I decided to give it a try so I deleted paypalusa and ftp'ed this one in. I can check out and pay but I get a blank page when it returns to the site after paying.

 

  • Like 1
Link to comment
Share on other sites

I'm having the same problem with paypal taking payment either by card or Paypal account but no order being created.

 

We have 1.6.0.6 with the standard Paypal module downloaded from addons.prestashop.com (v3.6.8), and Paypal Pro with 3 click checkout enabled, and SSL. We're using redirect. Is the iframe option secure? It works for us but doesn't redirect when customer's pay by card and I'm concerned about it's security.

 

In (v3.6.8) paypal.php there is no order-confirmation.php to change, it's just 'paypal_confirmation'.

 

Is this error not related to incorrect permissions in the module folder?

 

 

There is a temporary work-around for this problem of not receiving orders: 1.6 allows you to create the order from the shopping cart:

  1. Have the Paypal order email confirmation to hand so you can compare all the details: customer name, address, price etc.
  2. In back-end, go to 'customers'>'shopping cart' and find the customer's order/cart (usually minus shipping cost), click on it.
  3. Click the 'create an order from this cart' button in the 'order information' box.
  4. If the cart info is not already showng, type the customer's name into the search box, click 'choose' on the relevant one.
  5. The cart(s) will be underneath the customer's name/info, click the 'use' button on the relevant one.
  6. The cart info will appear below which is usually the same as the order placed. Check address, total price etc, everything is same as the Paypal order, and choose the correct order status (usually payment accepted), then click the 'create the order' button.
  7. This will create the order in the 'orders' section as it normally would have appeared.
Edited by Lee (see edit history)
Link to comment
Share on other sites

Thanks to all who helped...I would highly recommend that Prestashop make this a priority in their next upgrade.  PayPal US is broken and needs professional help.  While this work around solved it for me, it will continue to be an issue IMHO.  Thanks.

Link to comment
Share on other sites

 

That is Paypal Europe Not PayPalUSA and also appears to be the 1.5 branch??? of Github which is really what this post is about, That is also version 3.6.8 and with that version the issue of return to order-confirmation does not exist.

 

I looked here https://github.com/PrestaShop/PrestaShop/tree/1.6/modules and do not see any PayPal modules at all.

 

Thanks

Link to comment
Share on other sites

Please help me!

 

I have installed PS 1.6 and I don't have the file order-confirmation.php. So I created this file, put it in the prestashop root folder, and enter the following content:

 

<?php

require(dirname(__FILE__).'/config/config.inc.php');

Tools::redirect('index.php?controller=order-confirmation'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

 

 

Is this correct?

 

I'm using paypalusa but the return does not work. After finalizing a payment in paypal, the order is not generated.

 

Thank you for your attention!

Link to comment
Share on other sites

Please help me!

 

I have installed PS 1.6 and I don't have the file order-confirmation.php. So I created this file, put it in the prestashop root folder, and enter the following content:

 

<?php

 

require(dirname(__FILE__).'/config/config.inc.php');

 

Tools::redirect('index.php?controller=order-confirmation'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

 

 

Is this correct?

 

I'm using paypalusa but the return does not work. After finalizing a payment in paypal, the order is not generated.

 

Thank you for your attention!

Please read this post from the start there is a solution to this issue on page 1, Post #5 and an alternative module at post #11.

 

1.6 does not use the order-confirmation.php as in previous versions.

Link to comment
Share on other sites

Hello,

 

I am using Prestashop 1.6.0.6 and PayPal USA, Canada v1.3.3.

 

Everything works fine except Order Confirmation page showing 404 error returning from PayPal after payment. We have SEO Friendly URL disable and taxes are disable too.

After payment done, when user auto redirect to a 404 page not available for the order confirmation.

Here is what the link shows: [mysite]/order-confirmation.php?id_cart=20&id_module=73&key=[key]

I can see orders in admin and emails alerts working too.

 

I also changed order-confirmation.php to order-confirmation on paypalusa.php

 


Regards,
Hiren.

Link to comment
Share on other sites

If you made the change from order-confirmation.php to order-confirmation, then you would not be receiving a link with order-confirmation.php in it, wnow would you?

 

PaypalUsa Version 1.3.3 has order-confirmation.php in 5 different files, make sure you are changing the correct files based on your PS version

1) expresscheckout.php   (used in PS 1.4)

2) paypalusa.php (used in all PS versions)

3) validation.php (used in PS 1.4)

4) controllers/front/expresscheckout.php (used in PS 1.5+)

5) controllers/front/validation.php (used in PS 1.5+)

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Hi tdr170  I downloaded your module and I got this message below. Why is it so? please save me.

Error occurred:

Please try to contact the merchant:

  1. <b>PayPal response:</b>
  2. TIMESTAMP -> 2014-06-19T18:19:11Z
  3. L_ERRORCODE0 -> 10002
  4. L_SHORTMESSAGE0 -> Security error
  5. L_LONGMESSAGE0 -> Security header is not valid
  6. L_SEVERITYCODE0 -> Error
Edited by AMBER (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

The above also worked for the HiPay payment module, which was still configured to order-confirmation.php.

Not as compatible with 1.6 as they promise I guess.

I can confirm that this work also for HiPay module.

 

From 

$paymentParams->setIssuerAccountLogin($this->context->customer->email);
		$paymentParams->setUrlCancel(Tools::getShopDomainSsl(true).__PS_BASE_URI__.'order.php?step=3');
		$paymentParams->setUrlNok(Tools::getShopDomainSsl(true).__PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)$cart->id.'&id_module='.(int)$this->id.'&secure_key='.$customer->secure_key);
		$paymentParams->setUrlOk(Tools::getShopDomainSsl(true).__PS_BASE_URI__.'order-confirmation.php?id_cart='.(int)$cart->id.'&id_module='.(int)$this->id.'&secure_key='.$customer->secure_key);

To 

$paymentParams->setIssuerAccountLogin($this->context->customer->email);
		$paymentParams->setUrlCancel(Tools::getShopDomainSsl(true).__PS_BASE_URI__.'order?step=3');
		$paymentParams->setUrlNok(Tools::getShopDomainSsl(true).__PS_BASE_URI__.'order-confirmation?id_cart='.(int)$cart->id.'&id_module='.(int)$this->id.'&secure_key='.$customer->secure_key);
		$paymentParams->setUrlOk(Tools::getShopDomainSsl(true).__PS_BASE_URI__.'order-confirmation?id_cart='.(int)$cart->id.'&id_module='.(int)$this->id.'&secure_key='.$customer->secure_key);

Thanks.

Link to comment
Share on other sites

×
×
  • Create New...