Debugging why pro-sites didn't cancel site after failed payment

Trying to figure out why a site is still live after payment failed via stripe.
When sign up occurred on April 13th, was using PRO SITES VERSION 3.5.1.9

New sign ups are with a 14day free trial at level one.

She then upgraded her 14day trial the same day to the $29 a day plan.

However according to the stripe logs, no attempt to to bill was made on the 13th.

On the 27th, an attempt was made by stripe to bill the client, however the charge failed. Stripe then tried again on the 30th, may 5th, and again today may 12th, all failed.

However, the site is still active, and within the wordpress network admin, it says that pro-site features don't expire until may 27th. It also says that last payment date is April 27, 2016 (however no successful payment was made on this date)

3 days ago I upgraded to the latest pro-sites version, just wondering why pro-sites is not catching this failed payment(s) and not canceling the site.

Did I find another...bug.

Support access is open.

-Ben

    Ben

    Now going through some of the code, one of my modifications in pro-sites to fix one of the previous hot fixes is effecting the cancellation clause because of the additional time i am adding for a time window to extend.

    pro-sites-files/gateways/gateway-stripe.php line line 1534, used to be:

    if ( time() < $extend_window ) {
    	/* blog has already been extended by another webhook within the past
    		 5 minutes - don't extend again, but send receipt if its a payment */
    	if ( $is_payment ) {
    		//$psts->email_notification( $blog_id, 'receipt', false, $args );
    	}
    
    	return false;
    }

    and i changed it to:

    if ( time() < $extend_window ) {
    	/* blog has already been extended by another webhook within the past
    		 5 minutes - don't extend again, but send receipt if its a payment */
    	if ( $is_payment ) {
    		//$psts->email_notification( $blog_id, 'receipt', false, $args );
    	}
    	$ben_check = time() + 5400;
    	if ($ben_check < $extend_window ) { //ben
    		   return false;
    	} //ben
    }

    I did this added code to overcome a bug i found that was generated by a wpmudev hotfix in december.

    I've created statements to print out the time and variables found in $extend_window and time()

    in this scenario time() was: 1452713779 and the extend window was: 1452715407

    meaning my fix to the hot fix would allow the extend to occur.

    My fix to the hot fix can probably now be removed.

    That said...this code is so convoluted and unfathomably hard to follow that it really deserves a clean re-write.

    I don't know if this issue would be considered resolved as further testing is needed.

    Ivan Shulev

    Hey Ben ,

    I hope you are having a nice day so far!

    Please keep us posted, regarding the effects of removing your fix.

    this code is so convoluted and unfathomably hard to follow that it really deserves a clean re-write.

    I understand you completely as this plugin is quite complex and problems do arise with it.

    I hope there will be no more issues, but in case something comes up, we will do our best to help you solve it

    Thank you and I wish you an awesome day ahead!

    Ivan