Closed remcotolsma closed 2 years ago
Indeed, added a setting in https://github.com/pronamic/wp-pay-core/commit/901ed772c4ce58a584b5a9ee61c4599d425dba90
Notes:
@remcotolsma questions:
- Do we want to completely remove/reschedule the event(s) if the setting gets updated? Or leave the scheduled event and only check the current setting status when the action is being called?
I think an early return is the easiest in terms of code?
- Completing subscriptions should also be halted if the setting is disabled?
Is that necessary if we want to prevent a test/staging environment from sending emails?
Enable processing of recurring payments
I'm still wondering if we should change 'Enable processing of recurring payments' to 'Disable processing of recurring payments', that might indicate more that it is enabled by default but that you have the option to disable it.
Transformed to 'Disable starting recurring payments at gateway' setting in https://github.com/pronamic/wp-pay-core/commit/e1e0ce63eb3600145e8cab8edc913b800ac564c1
In the SubscriptionsModule::process_subscriptions_follow_up_payment()
we now also check if there is no event scheduled yet:
Is that necessary if we want to prevent a test/staging environment from sending emails?
It seems not, the SubscriptionsModule::complete_subscriptions()
also checks if there is no _pronamic_subscription_next_payment
meta. If processing is disabled, the subscriptions will still have their next payment date meta.
Might be relevant: https://docs.woocommerce.com/document/subscriptions-handles-staging-sites/.
I think @rvdsteege is already working on this.