Allow admin users to enter an email address to unsubscribe a donor from a plan
Currently there is no way to do this. At first I thought it'd be easy to filter subscriptions in the Stripe API call (https://stripe.com/docs/api#list_subscriptions) but this doesn't seem to be allowed. The other option is to list ALL subscriptions looking for the email address in each subscription.
Instead, we're currently listening for events on the webhook and creating an account
in our database with the email address and the Stripe Customer number so that we can do an immediate lookup. The final bit of this is to do the form in the admin interface (/admin/subscription/unsubscribe
perhaps) which can look up the Stripe Customer and perform an unsubscribe.
Further info: just looking now, perhaps we instead need to store the Stripe sub_abc123
number since that is used in the stripe.subscriptions.del()
call (https://stripe.com/docs/api#cancel_subscription).