Also, we can't just think PayPal. At least some thought needs putting into other payment gateways. Maybe we document what what supports, or build in capability reporting to the gateway hooks.
Old 4.3 code attached for a fork we had. Would need a lot of reworking. This actually does a number of things (in not a very well architected way honestly, needs a lot of work)...
Integrated subscription cancellation via API calls
When member is deleted, subscription is cancelled automatically
Ability to edit your card details via a nice UI [ideally this would become a tab on profile editing, and card fields would not show for direct editing]
Ability to have a free trial / discount on the first period
Emails on end of trial period
Redirecting to pay after login, if subscription trial has ended or last payment failed
Subscription payments taken via local payments API and CRON hooks
Notification emails on failure to take a subscription payment
There is scope here to use this patch, and these features, as inspiration for a much more sophisticated implementation of subscriptions than we currently have. Probably we're talking a couple of weeks of work at least to do it all well.
Integrated subscription cancellation via API calls
When member is deleted, subscription is cancelled automatically
Ability to edit your card details via a nice UI [ideally this would become a tab on profile editing, and card fields would not show for direct editing]
Ability to have a free trial / discount on the first period
Emails on end of trial period
Redirecting to pay after login, if subscription trial has ended or last payment failed
Subscription payments taken via local payments API and CRON hooks
Notification emails on failure to take a subscription payment
There is scope here to use this patch, and these features, as inspiration for a much more sophisticated implementation of subscriptions than we currently have. Probably we're talking a couple of weeks of work at least to do it all well.