wp-pay-core
wp-pay-core copied to clipboard
Calculating periods created is wrong with a subscription phase with an end date
https://github.com/pronamic/wp-pay-core/blob/bd197f4b1d3ddd2947c8d0a210171c2e7482bac7/src/Subscriptions/SubscriptionPhase.php#L293-L312
The next payment date can go far beyond the end date of a subscription phase.
Should we add something like this?
if ( null !== $this->end_date ) {
$next_date = \min( $next_date, $this->end_date );
}
Probably also rename the variable $next_date
to $anchor_date
or $pointer_date
?
CC @rvdsteege