Updates to 6.5.0

This commit is contained in:
WooCommerce
2024-07-16 10:11:59 +00:00
parent 73217b1ff9
commit b2a4dd8022
20 changed files with 222 additions and 113 deletions

View File

@@ -107,8 +107,11 @@ class WC_REST_Subscriptions_Controller extends WC_REST_Orders_Controller {
}
// Add subscription specific data to the base order response data.
$response->data['billing_period'] = $object->get_billing_period();
$response->data['billing_interval'] = $object->get_billing_interval();
$response->data['billing_period'] = $object->get_billing_period();
$response->data['billing_interval'] = $object->get_billing_interval();
$response->data['trial_period'] = $object->get_trial_period();
$response->data['suspension_count'] = $object->get_suspension_count();
$response->data['requires_manual_renewal'] = $object->get_requires_manual_renewal();
foreach ( wcs_get_subscription_date_types() as $date_type => $date_name ) {
$date = $object->get_date( wcs_normalise_date_type_key( $date_type ) );
@@ -396,6 +399,22 @@ class WC_REST_Subscriptions_Controller extends WC_REST_Orders_Controller {
'enum' => array_keys( wcs_get_subscription_period_strings() ),
'context' => array( 'view', 'edit' ),
),
'trial_period' => array(
'description' => __( 'Trial period for the subscription.', 'woocommerce-subscriptions' ),
'type' => 'string',
'enum' => array_keys( wcs_get_subscription_period_strings() ),
'context' => array( 'view', 'edit' ),
),
'suspension_count' => array(
'description' => __( 'The number of times the subscription has been suspended since the last payment.', 'woocommerce-subscriptions' ),
'type' => 'integer',
'context' => array( 'view', 'edit' ),
),
'requires_manual_renewal' => array(
'description' => __( 'Whether the subscription requires manual renewal.', 'woocommerce-subscriptions' ),
'type' => 'boolean',
'context' => array( 'view', 'edit' ),
),
'payment_details' => array(
'description' => __( 'Subscription payment details.', 'woocommerce-subscriptions' ),
'type' => 'object',