Stripe EOT Not Working

Hi There,

I’m currently testing stripe integrations and although I’ve found some things on this forum on this topic, it doesn’t appear to help.

Basically, I’ve got stripe options/pro-forms set up how you would expect, with an EOT grace time of 0 and an immediate downgrade to level 0 (no access to anything). There are no email subscriptions present. Paid member logs in, decides to cancel, goes to cancellation form.

Cancellation Form: [s2Member-Pro-Stripe-Form cancel=“1” desc=“This will immediately cancel your account. Are you sure?” unsub=“0” captcha=“clean” /]

After cancellation, paid member can still access everything he did before his cancellation request. I go into admin->users and see that his EOT time is set to expire in precisely 1 MONTH (which is the membership subscription duration) from his original sign up date. So it would appear that communication with stripe is working? However, access to protected pages was was supposed to be immediately after EOT regardless of when the member signed up.

So it appears that the issue is that the membership downgrade isn’t functioning as intended.

What am I missing? Can you guys lend me your knowledge?

Much appreciation,

Edit: I’ve also got some logs of the cancellation request, but I’m not entirely sure what I’m looking at…

Did a bit more research and realized that this issue is a “feature, not a bug.” Cancellation requests do not immediately downgrade a membership, but only cancel recurring billing and set an EOT time.

Still looking for solutions though.

Thanks,

If the member paid for the month, cancellation doesn’t change that. It just means the current month will be the last.

Yup. Looking at API Cancellation Notifications now. Will update if I can get to a solution!

<?php
//Ben Marley
//Set the role of the user to Subscriber and access to level0 after cancellation request
//User will be left with subscriber/participant roles
//Cancellation Notification: . . . /?s2_cancellation_notification=yes&user_id=%%user_id%%

add_action('init', 's2_cancellation_notification');
function s2_cancellation_notification()
    {
        if(!empty($_GET['s2_cancellation_notification']) && $_GET['s2_cancellation_notification'] === 'yes') 
            {
                if(!empty($_GET['user_id']))
                    {
                        $user_id     = (integer)$_GET['user_id']; 
            		$user = new WP_User($user_id); 
   			$user->remove_role("s2member_level2"); //Remove level2 role because he has many roles
   			$user->set_role("subscriber"); //Set the role to subscriber 
			
			//Add to log file	
			file_put_contents(WP_CONTENT_DIR.'/plugins/s2member-logs/my.log', 'Cancellation Notification Received for User ID: '.$user_id."\n", FILE_APPEND);						
                    }
                exit;
            }
    }
    
?>

Since I have the EOT behavior set to demote to level 0, I’m also not sure yet what exactly is going to happen during EOT so that’s something to test.