Allow customers to control what would be the default behavior of cancellation in the customer portal. A) - cancel and loose access immediately, B) cancel at billing period end.
Right now in customer portal the cancellation is immediate. Customers can not control the behavior of the customer portal, so even if the API for scheduled cancellations exists the whole point of it is lost because this edge case still needs to be covered.
Based on the cancellation mode a different dialog should appear and inform the user appropriately.
In most systems after the user completes a cancellation action the cancellation status is scheduled at the end of the billing period. Causing an immediate cancellation means that the user looses access for the period which has been paid for.
This in turn means that the current implementation needs to track cancellation status and billing period end where in other systems cancelled status can be affirmed as the final state due to scheduled cancellations.
Furthermore this requires additional complex logic to properly handle when the user wants discard the cancellation, meaning the creation of cron jobs for a new subscription.
Besides that instead of 1 visible subscription now the user will have additional subscription in the customer portal.
The other thing is that a customer can use the portal to switch subscriptions but after cancellation it would not be possible. This means that internally in the app of the customer the cancellation would still allow switching subscription tiers immediately, which would also require additional handling complex handling to discard internally the cancellation.
