Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscriptions follow-up payments controller and missed schedule #188

Open
remcotolsma opened this issue Jun 19, 2024 · 1 comment
Open

Comments

@remcotolsma
Copy link
Member

The subscriptions follow-up payments controller will only initiate follow-up payments for subscriptions where the next payment date is between now and 1 day ago:

/**
* Get query start date for subscriptions that require a follow-up payment.
*
* @return \DateTimeImmutable
* @throws \Exception Throws exception in case of error.
*/
private function get_follow_up_payment_query_start_date() {
return new \DateTimeImmutable( '-1 day', new \DateTimeZone( 'GMT' ) );
}
/**
* Get query end date for subscriptions that require a follow-up payment.
*
* @return \DateTimeImmutable
* @throws \Exception Throws exception in case of error.
*/
private function get_follow_up_payment_query_end_date() {
return new \DateTimeImmutable( 'now', new \DateTimeZone( 'GMT' ) );
}

Because this routine has to run every day, it should always work. However, there are situations where the routine does not run for a day or several days. For example, if a website is offline for a longer period of time due to a malfunction or something similar.

We cannot securely initiate payments for subscriptions with a next payment date in the past?

Subscriptions for which a follow-up payment has not been initiated on time remain active and administrators are not informed that there is a 'missed schedule'.

Should we introduce an extra controller that will put the 'missed schedule' subscriptions 'on hold'? By putting subscriptions with a next payment date that is more than 2 days in the past 'on hold'?

Or are there other options to better inform administrators about this?

CC @rvdsteege

@rvdsteege
Copy link
Member

Should we introduce an extra controller that will put the 'missed schedule' subscriptions 'on hold'?
[…]
Or are there other options to better inform administrators about this?

I'm not sure if putting the subscription 'On Hold' is "informing", should we not add an admin notice with a link to a list of such subscriptions and an option to somehow manually (bulk) try again? Clearly something has gone wrong in these cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants