Closed rvdsteege closed 2 years ago
@rvdsteege Shouldn't we also consider the "Access After Last Cycle" here?
I noticed that other gateways don't set the expires_at
value at all in the record_subscription_payment()
function. They let MemberPress figure this out in the MeprTransaction->store()
→ MeprTransaction::create( $txn )
function. As soon as a gateway (PayPal / Stripe) sends an expire notification they call MeprSubscription->limit_reached_actions()
? Since we don't get a notification from Mollie we have to figure out if it's the last payment / transaction for the MemberPress subscription?
if ( $pronamic_subscription->all_periods_created() ) {
$memberpress_subscription->limit_reached_actions();
}
https://github.com/wp-premium/memberpress/blob/main/app/models/MeprSubscription.php#L894-L931
From customer:
It seems we're always setting the
expires_at
date in the transaction if the payment periods contains a valid period, but should leave it empty if the transaction is the last transaction for the membership:https://github.com/pronamic/wp-pronamic-pay-memberpress/blob/4.0.1/src/Extension.php#L281-L304
I tried using
$period->get_phase()->get_subscription()->get_current_phase()->get_next_date()
there, which will benull
if there are no future follow-up payments, but it's not yet updated to the next date at this point in the payment flow.Internal Help Scout ticket: https://secure.helpscout.net/conversation/1794147711/23568