This commit is contained in:
Prospress Inc
2018-12-12 14:48:11 +01:00
committed by Remco Tolsma
parent 37367ac369
commit 721dda6e5c
340 changed files with 5114 additions and 2125 deletions

6
includes/api/legacy/class-wc-api-subscriptions.php Executable file → Normal file
View File

@@ -397,10 +397,8 @@ class WC_API_Subscriptions extends WC_API_Orders {
$dates_to_update = array();
foreach ( array( 'start', 'trial_end', 'end', 'next_payment' ) as $date_type ) {
if ( isset( $data[ $date_type . '_date' ] ) ) {
$date_type_key = ( 'start' === $date_type ) ? 'date_created' : $date_type;
$dates_to_update[ $date_type_key ] = $data[ $date_type . '_date' ];
$dates_to_update[ $date_type ] = $data[ $date_type . '_date' ];
}
}
@@ -461,7 +459,7 @@ class WC_API_Subscriptions extends WC_API_Orders {
$subscription_data['billing_schedule'] = array(
'period' => $subscription->get_billing_period(),
'interval' => $subscription->get_billing_interval(),
'start_at' => $this->get_formatted_datetime( $subscription, 'date_created' ),
'start_at' => $this->get_formatted_datetime( $subscription, 'start' ),
'trial_end_at' => $this->get_formatted_datetime( $subscription, 'trial_end' ),
'next_payment_at' => $this->get_formatted_datetime( $subscription, 'next_payment' ),
'end_at' => $this->get_formatted_datetime( $subscription, 'end' ),