Cannot save Stripe keys on a site with HTTP only

[ad_1]

The problem started with version 8.0.0 running with PHP 7.4.

Steps to reproduce:

  1. Site with HTTP only
  2. Setup WooCommerce
  3. Activate WooCommerce Stripe Payment Gateway
  4. Setup the Stripe payment (note: in HTTP only, it shows a button “Enter account keys (advanced)”)
  5. Click on “Enter account keys (advanced)” and fill the public and private key (we did it on the “Test” tab)
  6. Click on “Save test keys”

=> You get an error notice “Error saving account keys”.

And we have several debug.log entries:

[01-Mar-2024 12:02:37 UTC] PHP Notice:  Undefined index: publishable_key in /shared/httpd/wpml/htdocs/wp-content/plugins/woocommerce-gateway-stripe/includes/admin/class-wc-rest-stripe-account-keys-controller.php on line 240
[01-Mar-2024 12:02:37 UTC] PHP Notice:  Undefined index: secret_key in /shared/httpd/wpml/htdocs/wp-content/plugins/woocommerce-gateway-stripe/includes/admin/class-wc-rest-stripe-account-keys-controller.php on line 241
[01-Mar-2024 12:02:37 UTC] PHP Notice:  Undefined index: test_publishable_key in /shared/httpd/wpml/htdocs/wp-content/plugins/woocommerce-gateway-stripe/includes/admin/class-wc-rest-stripe-account-keys-controller.php on line 242
[01-Mar-2024 12:02:37 UTC] PHP Notice:  Undefined index: test_secret_key in /shared/httpd/wpml/htdocs/wp-content/plugins/woocommerce-gateway-stripe/includes/admin/class-wc-rest-stripe-account-keys-controller.php on line 243
[01-Mar-2024 12:02:37 UTC] PHP Notice:  Undefined index: testmode in /shared/httpd/wpml/htdocs/wp-content/plugins/woocommerce-gateway-stripe/includes/admin/class-wc-rest-stripe-account-keys-controller.php on line 247

Note that when I downgrade to version 7.9.3, I manage to save the keys even though I have several entries in debug.log which is probably the reason of this other report https://projectdmc.org/support/topic/cannot-save-settings-26/ (some newer PHP version might be less fault-tolerant).

Note 1: With HTTPS, we have a different GUI workflow.
Note 2: This problem was caught on an automated E2E test which started to fail due to this new version 8.0.0 (it’s a regression).

  • This topic was modified 3 hours, 56 minutes ago by Pierre Sylvestre. Reason: Add 2 notes

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer