OpenMage / magento-lts

Official OpenMage LTS codebase | Migrate easily from Magento Community Edition in minutes! Download the source code for free or contribute to OpenMage LTS | Security vulnerability patches, bug fixes, performance improvements and more.
https://www.openmage.org
Open Software License 3.0
865 stars 436 forks source link

Missing payment method CCsave crashes seeing older orders or invoices #3441

Open vincentRobot opened 1 year ago

vincentRobot commented 1 year ago

Preconditions (*)

  1. OpenMage 19.4.18

Steps to reproduce (*)

  1. Try an view an older order or invoice that was paid by CCsave method from magento 1.9 it will crash the site

Expected result (*)

  1. we should be able to see the order instead the site crashes because that payment method CCsave is missing .

Actual result (*)

  1. site crashes : image image exception log : 1481985719546.log

It is possible to keep CCsave as a payment method (even if it's not PCI compliant) with OpenMage ? if not how I can 'mock a payment method" that will help me see older orders & invoices in the admin site ?

thanks

elidrissidev commented 1 year ago

I don't know about PCI compliance, but the error you're facing is normal. As far as I see, the Ccsave method is still provided by default in OpenMage, if you remove it while you have older orders using it, it's going to throw that error due to the payment method's class missing.

vincentRobot commented 1 year ago

@elidrissidev : Thanks I agree the error looks normal under the circumstances. This is extremely weird since I didn't remove the payment method. OpenMage was installed via composer over an existing magento 1.9 site in order to keep my customizations. https://github.com/OpenMage/magento-lts#composer. I was under the impression composer would overwrite the core files only but perhaps this created the problem ? Should I reinstall ? or perhaps you can tell me which files are responsible for the ccsave payment method and I will add them manually.

Thanks for your help

elidrissidev commented 1 year ago

From my experience, even if there were issues during the process of copying files it shouldn't cause the files to get deleted since they existed since M1.

You should make sure the below file exists, as well as the blocks referenced by it like payment/info_ccsave:

https://github.com/OpenMage/magento-lts/blob/main/app/code/core/Mage/Payment/Model/Method/Ccsave.php

elidrissidev commented 1 year ago

Is your issue solved, @vincentRobot?

vincentRobot commented 1 year ago

I think so @elidrissidev. I ended up getting help through the discord group. https://discord.com/channels/408199701196963842/408199701196963844/threads/1141018532277129236

The solution I have right now is a little over the top i think since we are activating the payment option in the local.xml file but it works. Screenshot 2023-08-16 at 17-01-30 Discord - A New Way to Chat with Friends   Communities

it just puzzles me that it had to be done like that. I mean I have all the files but without the modification to local.xml the payment method ccsave just doesn't work.

If you have time, I'd love to know your thoughts on this.

elidrissidev commented 1 year ago

Ahh, I didn't know the payment method was removed from the config in a security patch by Magento a long time ago. It doesn't really matter where you add it, either local.xml or Mage/Payment/etc/config.xml will do the trick.

We could possibly make the changes necessary in OpenMage to make it at least support opening orders with a deleted payment method, perhaps show only the method code and a text saying it no longer exists.

empiricompany commented 10 months ago

I would also like to add that I recently found that the issue also occurs in fontend in all pages if the customer has an abandoned cart with an unavailable payment method. To resolve it, I had to remove the payment method in the sales_flat_quote_payment table (I don't remember all the tables exactly).

fballiano commented 4 months ago

when this things happen (when the store switches from a payment provider to another) I change the payment method saved on the DB on the sales_flat_order tables, it's easier than trying to restore the payment method.