mollie / PrestaShop

iDEAL, Creditcard, Bancontact, SOFORT, Bank transfer, PayPal & paysafecard for Prestashop
http://www.mollie.com
BSD 2-Clause "Simplified" License
70 stars 43 forks source link

orderReference issue after updating (clean) from v3.5.5 to v4.0.7 #198

Closed coMegaWebMaster closed 4 years ago

coMegaWebMaster commented 4 years ago

Expected behavior: An extra paid module should change the order reference, this was no issue in the old Mollie version 3.5.5.

Actual behavior: Due to the new version, the: $orderReference = Order::generateReference(); in Mollie itself is causing that the order reference is not what is set in the paid module.

More details: I did a clean install, so everything was removed and installed Mollie version 4.0.7, had no issues, until I saw the orders came in. What I think is that these are causing this issue: mollie\controllers\front\payment.php Line 124: $orderReference = Order::generateReference();

mollie\src\Service\PaymentMethodService.php Line 235: $this->module->currentOrderReference = $orderReference = Order::generateReference();

The paid module to change the order reference is using a standard way in the /override/classes/order/OrderPayment.php But this does not work anymore now, hopefully this can be changed, at least that a set override will go first.

Environment:

SimonasB88 commented 4 years ago

Hey @coMegaWebMaster thanks for your insights!

Well, the cause of the majority of Fatal PHP errors is that the newest v4.x.x version has been refactored and majority of code construction is not aligned with the v3.x.x. So the unpacking of the files and overriding old ones is causing some conflicts. So the clean installing or the old version reinstalling makes things to work out. The team is looking forward to the solving of this issue.

However, could you give more bug reproduction information regarding "until I saw the orders came in." ? Some graphics, video screen captures?

Thanks. Best Regards.

coMegaWebMaster commented 4 years ago

I think it is better I go back to version 3.5.5, as am missing also the Mollie hook in the order page.

I had a chat with the Mollie support also today, that was about getting a error 500 page in the FO after choosing SEPA, I give all access codes and I will leave the new version for one more day, but I will change back to the old version in the weekend.

SimonasB88 commented 4 years ago

Hey @coMegaWebMaster thanks for your message!

We have backloged this case and we will let you know about the updates!

Best Regards.

SimonasB88 commented 4 years ago

Hey @coMegaWebMaster we have some updates from the dev team:

Created an override that generates References and it seems that override is generating reference first. We created override which adds “TEST” to beginning of reference public static function generateReference(){ return strtoupper("TEST" . Tools::passwdGen(9, 'NO_NUMERIC'));}

After doing a test payment we get this reference in Prestashop.

image

You can see that order reference begins with “TEST”. Plus, in Default Prestahsop only reference max length should be 9 symbols. Because in database reference column accepts reference with max length of 9 symbols.

image

I think you tried to upgrade the module from 3.5.5 version to 4.0.7 that why you got duplicated orders statuses. If you want to upgrade from 3.x.x version to 4.x.x. version you need to uninstall entirely module, even from folders, because in 4.x.x module core has been improved so much that we can say that 3.x.x version 4.x.x versions are almost like different modules.

Tested with 3.5.5 version and if the client is talking about this hook in order page: image

This hook still exists in 4.0.7 version: image

Looking forward to hearing from you!

Best Regards.

SimonasB88 commented 4 years ago

Hey everyone! The thread is closed due the inactivity for some time. Please raise a new ticket if it is necessary.

Have a great day! Best Regards.

coMegaWebMaster commented 4 years ago

@SimonasB88 Am using a module that is creating order references, like for the domain .nl the order reference will be NL000001, NL000002 and so on and for domain .be it will be BE000001, BE000002 and so on. In the old version the module is working as it should, but with the new version Mollie is overriding the module reference. I did not upgrade, as I know that it is causing issues and as said I started fresh.

margud commented 4 years ago

@coMegaWebMaster Is your reference created in generateReference() override? If so it should work just fine. If you are changing it in another place then its not much we can do about it, because we are using default prestashop function to generate it.

coMegaWebMaster commented 4 years ago

Could you shoot me a PM? Then I can send you it.

SimonasB88 commented 4 years ago

Hey @coMegaWebMaster please send the information to support@invertus.eu. Thank you.

Best Regards.

coMegaWebMaster commented 4 years ago

I will do tonight.