202-ecommerce / stripe_official

After years of hard work with Stripe connector for PrestaShop, 202 ecommerce stop the development of Stripe module on January 9th 2023. Thanks for all contributors that help us!
20 stars 20 forks source link

Uninstall doesn't fully remove the module and causes conflicts with other stripe modules #156

Closed githubjonny closed 2 years ago

githubjonny commented 2 years ago

Hello, On a vanilla prestashop website 1.7.8.6, installing this module then uninstalling it results in other stripe modules not being displayed during the checkout.

To replicate the issues:

1) Create a new install of Prestashop 1.7.8.6 2) Install the official stripe module (v2.4.4) then in the configuration page add the stripe test API keys. Then tick "Display an extended version of the form with card logos instead of the compact version. Choose the logos to display below based on the brands accepted by your Stripe account." and tick "Digital wallets, i.e. Apple Pay and Google Pay. By using Apple Pay, you agree to Stripe and Apple's terms of service". Leave all others unticked then click save. 3) Uninstall the Official stripe module. 4) Install the JA stripe subscription module and add the test API keys then save. 5) As a customer, go through the checkout and you should see the payment module is not displayed (acts like the hook is missing).

I have contacted JA Modules regarding their module and they have stated:

"I'm sorry to say that the Official Stripe module should be disabled or uninstalled as they try to load the same resource and this makes them incompatible."

However, since the official module is already uninstalled / deleted, there must be records left in the database from the official stripe module that is causing a conflicts.

Can anyone confirm which records are still left in the database when the official stripe module is uninstalled?

githubjonny commented 2 years ago

From what I can see, the official stripe module leaves the following records in the database (ps_configuration) even when it has been uninstalled / deleted.

CONF_STRIPE_OFFICIAL_FIXED CONF_STRIPE_OFFICIAL_VAR CONF_STRIPE_OFFICIAL_FIXED_FOREIGN CONF_STRIPE_OFFICIAL_VAR_FOREIGN STRIPE_MINIMUM_AMOUNT_3DS STRIPE_OS_SOFORT_WAITING STRIPE_CAPTURE_WAITING STRIPE_SEPA_WAITING STRIPE_SEPA_DISPUTE STRIPE_OXXO_WAITING STRIPE_TEST_KEY STRIPE_TEST_PUBLISHABLE STRIPE_CATCHANDAUTHORIZE STRIPE_SAVE_CARD STRIPE_WEBHOOK_SIGNATURE STRIPE_WEBHOOK_ID STRIPE_ACCOUNT_ID STRIPE_ENABLE_APPLEPAY_GOOGLEPAY STRIPE_REINSURANCE

However, the JA stripe module seems to use a different structure for database:

CONF_JSTRIPESUBSCRIPTIONS_FIXED CONF_JSTRIPESUBSCRIPTIONS_VAR CONF_JSTRIPESUBSCRIPTIONS_FIXED_FOREIGN CONF_JSTRIPESUBSCRIPTIONS_VAR_FOREIGN JSTRIPESUBSCRIPTIONS_MODE JSTRIPESUBSCRIPTIONS_PUBLISHABLE_KEY JSTRIPESUBSCRIPTIONS_SECRET_KEY JSTRIPESUBSCRIPTIONS_SHIPPING JSTRIPESUBSCRIPTIONS_TOKEN

Is there any other settings / database information that is left by the official stripe module when uninstalled?

clotairer commented 2 years ago

@githubjonny

The Official Stripe module define as const all configurations here : https://github.com/202-ecommerce/stripe_official/blob/6ee73a4436bbba1951728bf7020979a849d570f3/stripe_official.php#L57-L65 ...

All are prefixed by STRIPE_XXX. https://github.com/202-ecommerce/stripe_official/blob/6ee73a4436bbba1951728bf7020979a849d570f3/stripe_official.php#L576-L587

I confirm all configuration are not removed. It's probably a bug for those who are not linked to order state ID. But if you want to clean you PrestaShop, you can remove all configurations STRIPE_XXX.

CONFSTRIPE >>> NOT from Stripe Official. JSTRIPESUBSCRIPTIONS_ >>> NOT from Stripe Official.

According to database tables of the module, they are not automatically removed because, if you are a merchand and uninstall the module, old order paid by Stripe need payment history. That's why, this module don't remove tables. All tables of the module are prefixed by ps_stripe_xxx and associated to an object model in classes directory.

You can remove states associated to Stripe module too (SOFORT_WAITING, CAPTURE_WAITING, ...) . They are not deleted for the same reason why tables are not removed.