Calculating periods created is wrong with a subscription phase with an end date
Opened this issue · 1 comments
remcotolsma commented
wp-pay-core/src/Subscriptions/SubscriptionPhase.php
Lines 293 to 312 in bd197f4
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
rvdsteege commented
Should we add something like this?
As discussed at HQ, I think that that would be correct to fix the calculation.