woocommerce / woocommerce-gateway-paypal-express-checkout

58 stars 65 forks source link

Bump WooCommerce requirement to 3.2.0 #868

Closed jorgeatorres closed 3 years ago

jorgeatorres commented 3 years ago

Description

While looking into #855, I noticed that despite what our README says (the current min. requirement is WC 2.6), PPEC doesn't work correctly on WC < 3.2.0: we are already implicitly requiring 3.0.0 because our code uses wc_get_price_including_tax() and other similar functions. Also on WC < 3.2.0, the cart total is calculated as "0.0" which is not only incorrect but prevents the order from being created on PayPal's side (this makes sense given various cart classes were refactored in 3.2.0).

In this PR, the 3.2.0 requirement is made explicit, which is probably fine given it has been broken for a while and we haven't seen reports about it. Also, we were already alerting merchants that the requirement was going to be bumped to 3.0.0 and this was supposed to happen in Q1 2020, so Q2 2021 seems safe...r.

This PR also adds a minor change to the way we display expiry information for API certificates. Code to display the expiry date in local time was added in #696, which makes use of wp_timezone(), a function introduced in WP 5.0. Instead of bumping this requirement too, given WC 3.2.0 requires WP 4.4 (which is our current WP requirement), I believe displaying the time in UTC for those sites still on WP < 5.0 is a good compromise, and it's the approach I took in this PR.

Steps to test:

Not much to test.

Changelog entry

Enter a summary of all changes on this Pull Request. This will appear in the changelog if accepted.

  • Bump WooCommerce requirement to 3.2.0.
  • Add compatibility fix for WordPress < 5.0.

Closes #855.

james-allan commented 3 years ago

I believe displaying the time in UTC for those sites still on WP < 5.0 is a good compromise

Yep agreed. 👍 LGTM