Updates to 6.4.0

This commit is contained in:
WooCommerce
2024-06-28 10:13:55 +00:00
parent f98586942f
commit 73217b1ff9
9 changed files with 48 additions and 21 deletions

View File

@@ -1,5 +1,8 @@
*** WooCommerce Subscriptions Changelog *** *** WooCommerce Subscriptions Changelog ***
2024-06-28 - version 6.4.1
* Fix: Resolved errors preventing subscription-related webhooks from sending on WC 9.0 stores.
2024-06-13 - version 6.4.0 2024-06-13 - version 6.4.0
* Add: New WP CLI support to manage subscriptions via command line. * Add: New WP CLI support to manage subscriptions via command line.
* Add: Introduce wc/v2 subscription REST API endpoints. * Add: Introduce wc/v2 subscription REST API endpoints.

View File

@@ -151,4 +151,23 @@ class WCS_API {
return (bool) preg_match( '/\/wc\/v[1-3]\/orders\b/', $GLOBALS['wp']->query_vars['rest_route'] ); return (bool) preg_match( '/\/wc\/v[1-3]\/orders\b/', $GLOBALS['wp']->query_vars['rest_route'] );
} }
/**
* Fetches WooCommerce API endpoint data in a WooCommerce version compatible way.
*
* This method is a wrapper for the WooCommerce API get_endpoint_data method. In WooCommerce 9.0.0 and later, the
* WC()->api was deprecated in favor of the new Automattic\WooCommerce\Utilities\RestApiUtil class.
*
* @since 6.4.1
*
* @param string $endpoint The endpoint to get data for.
* @return array|\WP_Error The endpoint data or WP_Error if the request fails.
*/
public static function get_wc_api_endpoint_data( $endpoint ) {
if ( wcs_is_woocommerce_pre( '9.0.0' ) ) {
return WC()->api->get_endpoint_data( $endpoint );
}
return wc_get_container()->get( Automattic\WooCommerce\Utilities\RestApiUtil::class )->get_endpoint_data( $endpoint );
}
} }

View File

@@ -132,6 +132,11 @@ class WCS_Webhooks {
switch ( $webhook->get_api_version() ) { switch ( $webhook->get_api_version() ) {
case 'legacy_v3': case 'legacy_v3':
if ( is_null( wc()->api ) ) {
throw new \Exception( 'The Legacy REST API plugin is not installed on this site. More information: https://developer.woocommerce.com/2023/10/03/the-legacy-rest-api-will-move-to-a-dedicated-extension-in-woocommerce-9-0/ ' );
}
WC()->api->WC_API_Subscriptions->register_routes( array() ); WC()->api->WC_API_Subscriptions->register_routes( array() );
$payload = WC()->api->WC_API_Subscriptions->get_subscription( $resource_id ); $payload = WC()->api->WC_API_Subscriptions->get_subscription( $resource_id );
break; break;
@@ -147,7 +152,7 @@ class WCS_Webhooks {
break; break;
case 'wp_api_v3': case 'wp_api_v3':
$payload = wc()->api->get_endpoint_data( "/wc/v3/subscriptions/{$resource_id}" ); $payload = WCS_API::get_wc_api_endpoint_data( "/wc/v3/subscriptions/{$resource_id}" );
break; break;
} }

View File

@@ -2,14 +2,14 @@
# This file is distributed under the same license as the WooCommerce Subscriptions plugin. # This file is distributed under the same license as the WooCommerce Subscriptions plugin.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: WooCommerce Subscriptions 6.4.0\n" "Project-Id-Version: WooCommerce Subscriptions 6.4.1\n"
"Report-Msgid-Bugs-To: https://woocommerce.com/contact-us\n" "Report-Msgid-Bugs-To: https://woocommerce.com/contact-us\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2024-06-13T01:43:31+00:00\n" "POT-Creation-Date: 2024-06-28T01:10:56+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.9.0\n" "X-Generator: WP-CLI 2.9.0\n"
"X-Domain: woocommerce-subscriptions\n" "X-Domain: woocommerce-subscriptions\n"

2
vendor/autoload.php vendored
View File

@@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) {
require_once __DIR__ . '/composer/autoload_real.php'; require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit02567f250c7765c8ea2ed71a416c6653::getLoader(); return ComposerAutoloaderInitb6faa2b65c1d08bc372be5e5be1acee6::getLoader();

View File

@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer // autoload_real.php @generated by Composer
class ComposerAutoloaderInit02567f250c7765c8ea2ed71a416c6653 class ComposerAutoloaderInitb6faa2b65c1d08bc372be5e5be1acee6
{ {
private static $loader; private static $loader;
@@ -24,12 +24,12 @@ class ComposerAutoloaderInit02567f250c7765c8ea2ed71a416c6653
require __DIR__ . '/platform_check.php'; require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit02567f250c7765c8ea2ed71a416c6653', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInitb6faa2b65c1d08bc372be5e5be1acee6', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit02567f250c7765c8ea2ed71a416c6653', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInitb6faa2b65c1d08bc372be5e5be1acee6', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php'; require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit02567f250c7765c8ea2ed71a416c6653::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInitb6faa2b65c1d08bc372be5e5be1acee6::getInitializer($loader));
$loader->register(true); $loader->register(true);

View File

@@ -4,7 +4,7 @@
namespace Composer\Autoload; namespace Composer\Autoload;
class ComposerStaticInit02567f250c7765c8ea2ed71a416c6653 class ComposerStaticInitb6faa2b65c1d08bc372be5e5be1acee6
{ {
public static $prefixLengthsPsr4 = array ( public static $prefixLengthsPsr4 = array (
'C' => 'C' =>
@@ -129,9 +129,9 @@ class ComposerStaticInit02567f250c7765c8ea2ed71a416c6653
public static function getInitializer(ClassLoader $loader) public static function getInitializer(ClassLoader $loader)
{ {
return \Closure::bind(function () use ($loader) { return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit02567f250c7765c8ea2ed71a416c6653::$prefixLengthsPsr4; $loader->prefixLengthsPsr4 = ComposerStaticInitb6faa2b65c1d08bc372be5e5be1acee6::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit02567f250c7765c8ea2ed71a416c6653::$prefixDirsPsr4; $loader->prefixDirsPsr4 = ComposerStaticInitb6faa2b65c1d08bc372be5e5be1acee6::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit02567f250c7765c8ea2ed71a416c6653::$classMap; $loader->classMap = ComposerStaticInitb6faa2b65c1d08bc372be5e5be1acee6::$classMap;
}, null, ClassLoader::class); }, null, ClassLoader::class);
} }

View File

@@ -1,9 +1,9 @@
<?php return array( <?php return array(
'root' => array( 'root' => array(
'name' => 'woocommerce/woocommerce-subscriptions', 'name' => 'woocommerce/woocommerce-subscriptions',
'pretty_version' => 'dev-release/6.4.0', 'pretty_version' => 'dev-release/6.4.1',
'version' => 'dev-release/6.4.0', 'version' => 'dev-release/6.4.1',
'reference' => '4f5a7362b75b8b0f747cc271320809adba667cb7', 'reference' => '1731999c38ad73e9593177e016f02aa815ed4dca',
'type' => 'wordpress-plugin', 'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),
@@ -41,9 +41,9 @@
'dev_requirement' => false, 'dev_requirement' => false,
), ),
'woocommerce/woocommerce-subscriptions' => array( 'woocommerce/woocommerce-subscriptions' => array(
'pretty_version' => 'dev-release/6.4.0', 'pretty_version' => 'dev-release/6.4.1',
'version' => 'dev-release/6.4.0', 'version' => 'dev-release/6.4.1',
'reference' => '4f5a7362b75b8b0f747cc271320809adba667cb7', 'reference' => '1731999c38ad73e9593177e016f02aa815ed4dca',
'type' => 'wordpress-plugin', 'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../', 'install_path' => __DIR__ . '/../../',
'aliases' => array(), 'aliases' => array(),

View File

@@ -5,11 +5,11 @@
* Description: Sell products and services with recurring payments in your WooCommerce Store. * Description: Sell products and services with recurring payments in your WooCommerce Store.
* Author: WooCommerce * Author: WooCommerce
* Author URI: https://woocommerce.com/ * Author URI: https://woocommerce.com/
* Version: 6.4.0 * Version: 6.4.1
* Requires Plugins: woocommerce * Requires Plugins: woocommerce
* *
* WC requires at least: 8.7.1 * WC requires at least: 8.7.1
* WC tested up to: 8.9.0 * WC tested up to: 9.0.0
* Woo: 27147:6115e6d7e297b623a169fdcf5728b224 * Woo: 27147:6115e6d7e297b623a169fdcf5728b224
* *
* Copyright 2019 WooCommerce * Copyright 2019 WooCommerce
@@ -78,7 +78,7 @@ class WC_Subscriptions {
public static $plugin_file = __FILE__; public static $plugin_file = __FILE__;
/** @var string */ /** @var string */
public static $version = '6.4.0'; // WRCS: DEFINED_VERSION. public static $version = '6.4.1'; // WRCS: DEFINED_VERSION.
/** @var string */ /** @var string */
public static $wc_minimum_supported_version = '7.7'; public static $wc_minimum_supported_version = '7.7';