Jump to content

Paypal integral evolution return url with id_order=0 : no order in BO


b_lab_31

Recommended Posts

Hi there,

 

i've been trying to find a solution everywhere, including on this forum, but i'm unable to fix it so I'll post my own topic.

I'm on Prestashop 1.6.1.5 with up-to-date Paypal module (3.11.1).

My shop is pretty standard, it’s in french, and i just went live yesterday with a new version of my website, url is : www.mobiho-essentiel.fr

 

I use « one page checkout », and guest orders are accepted.

I have a business Paypal account, and i would like to use Paypal integral evolution, but i can’t.

 

My issue :

- if I use Paypal integral, everything works fine, payment and order creation in back-office are alright.

- if I switch to Paypal Integral Evolution, payment is still ok, but once it's done, no order in my BO

 

Reason is : after payment, when using Integral Evolution, the return URL has a parameter id_order=0. When using Integral, instead, return id_order parameter is ok, for example a few minutes ago :

/module/paypal/submit?key...18&id_cart=79&id_order=42

 

 

 

I used to have the exact same problem with the previous version of my website (that i didn’t build myself). So i’m guessing it’s probably due to a wrong parameter in my paypal account rather than to the paypal module or Prestashop itself.

So here are the URL i use on my Paypal account, maybe a user with a working-as-intended install of integral evolution can check if it looks ok ?

Notification instantanée de paiement (IPN)

URL de notification

http://www.mobiho-essentiel.fr/modules/paypal/ipn.php

 

Return URL after payment : i tried with nothing in this field, and also with http://www.mobiho-essentiel.fr/confirmation-commande or http://www.mobiho-essentiel.fr/order-confirmation , it doesn’t seem to change anyting

 

If anyone has a clue what is going on, it would be a great help, thanks

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I've the same exact issue.

Url confirmation is built with id_order=0, i.e.:

/module/paypal/submit?id_cart=19&id_module=87&id_order=0&key=4a6617b44f87913235a764d3bb6b7430

Point where confirmation url is built is /paypal/integral_evolution/submit.php file, line 81:

 

    // Redirection
    $values = array(
        'id_cart' => (int) $id_cart,
        'id_module' => (int) Module::getInstanceByName('paypal')->id,
        'id_order' => (int) Order::getOrderByCartId((int) $id_cart),
    );
As you can see the order is retrieved by cart id, that is correctly passed.
I will dig in the queries to see where is the issue.
Will make you know soon.
 
Manfredi
 
 

 

  • Like 1
Link to comment
Share on other sites

I solved the issue on my side, changing these lines in 

/modules/paypal/controllers/front/submit.php

Line 45, from

$this->id_order = (int) Tools::getValue('id_order');

to

 $this->id_cart = (int) Tools::getValue('id_cart');
 $this->id_order = (int) Order::getOrderByCartId((int) $this->id_cart);

Obviously this is not the right way to proceed, but it is just a workaround that will be reset on updating Paypal module.

 

Moreover, the real issue seems to be on ipn.php (PayPalIPN class), here:

$id_order = (int) PayPalOrder::getIdOrderByTransactionId($txn_id);

I will open an issue in PayPal module code repository, in order to make give a look to that.

 
Cheers.
Edited by manfield (see edit history)
  • Like 1
Link to comment
Share on other sites

Hi guys!

 

Tried in my store and didn't work....

I'm using PayPal PRO...is this the integral evolution version ?!?

 

Regards,

 

 

I solved the issue on my side, changing these lines in 

/modules/paypal/controllers/front/submit.php

Line 45, from

$this->id_order = (int) Tools::getValue('id_order');

to

 $this->id_cart = (int) Tools::getValue('id_cart');
 $this->id_order = (int) Order::getOrderByCartId((int) $this->id_cart);

Obviously this is not the right way to proceed, but it is just a workaround that will be reset on updating Paypal module.

 

Moreover, the real issue seems to be on ipn.php (PayPalIPN class), here:

$id_order = (int) PayPalOrder::getIdOrderByTransactionId($txn_id);

I will open an issue in PayPal module code repository, in order to make give a look to that.

 
Cheers.

 

Link to comment
Share on other sites

Hi guys!

 

Tried in my store and didn't work....

I'm using PayPal PRO...is this the integral evolution version ?!?

 

Regards,

 

Sorry....forget to say on my BO order is created Always but on FO customers see completly wrong data with ID order, ID transaction and TOTAL amount SAME always...

 

This module is very messy and no one on PayPal side looks interested to solve this problems on last years!!!

Link to comment
Share on other sites

  • 3 weeks later...

AND using PayPal ipn the orders do not return to Prestashop order confirmation page, so are untrackable in analytics. The PayPal module seems very buggy using IPN which seems only to be used in the 'integral' eveolution part of it. The rest seems to use PayPal API

Link to comment
Share on other sites

 

I solved the issue on my side, changing these lines in 

/modules/paypal/controllers/front/submit.php

Line 45, from

$this->id_order = (int) Tools::getValue('id_order');

to

 $this->id_cart = (int) Tools::getValue('id_cart');
 $this->id_order = (int) Order::getOrderByCartId((int) $this->id_cart);

Obviously this is not the right way to proceed, but it is just a workaround that will be reset on updating Paypal module.

 

Moreover, the real issue seems to be on ipn.php (PayPalIPN class), here:

$id_order = (int) PayPalOrder::getIdOrderByTransactionId($txn_id);

I will open an issue in PayPal module code repository, in order to make give a look to that.

 
Cheers.

 

 

Hi Manfield,

 

Thank you very much for sharing your solution.

 

I have the same problem but unfortunately your workaround does not work on my website. I would like to know if you did anything else besides what you have done such as activating IPN on your Paypal account and changing the url return page for exemple.

 

I am using the latest vesion of the module Paypal version 3.11.1 on a Prestashop version 1.5.3.1.

 

Would you mind maybe upload your paypal module so I can try ?

 

Thank you very much for what you did,

 

However I dont know if this can help, but I have noticed that the problem disapear if I choose to pay with my paypal account directly. In other words, If I pay by typing my credit card information, the problem comes and I get the redirection page with  id_order=0.

 

 

Sincerely,

 

Cyril

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

  • 6 months later...
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...