Thanks for the follow-up Rob.
Let me start by saying… this has been reported before. The solution that we recommend, is to change your BuddyPress settings in the Dashboard, and do NOT allow Members to delete their own account. Instead, use an s2Member Pro Cancellation Form, so that Members can “cancel” their own account, not delete it. If you want accounts deleted automatically (i.e. after a Member cancels, and at the correct time), you can change your EOT Behavior for s2Member here: Dashboard -› s2Member® -› PayPal® Options -› Automatic EOT Behavior
That being said, if you’d like to integrate a more advanced solution, you could automatically cancel a Customer’s billing profile dynamically, via PHP — using s2Member’s integration with the PayPal Pro API. Here is an example.
Create this directory and file:
/wp-content/mu-plugins/s2-hacks.php
( these are MUST USE plugins, see: http://codex.wordpress.org/Must_Use_Plugins )
<?php
add_action("delete_user", "cancel_future_billing");
function cancel_future_billing($user_id)
{
$paypal = (array)array
(
"ACTION" => "Cancel",
"METHOD" => "ManageRecurringPaymentsProfileStatus",
"PROFILEID" => get_user_option("s2member_subscr_id", $user_id)
);
c_ws_plugin__s2member_paypal_utilities::paypal_api_response($paypal);
}
?>