/**
  * @param Mage_Sales_Model_Recurring_Profile $profile
  * @param bool $bool
  * @return bool
  *
  * check Maximum Payment Failures
  * Maximum Payment Failures <= 0 -> run forever
  * Maximum Payment Failures > 0 -> save countFailures into additional Info
  * if isset countFailures -> countFailures - 1
  * if countFailures = 0 -> profile is suspended
  * if Maximum Payment Failures = null -> run forever
  */
 public function checkMaxPaymentFailures(Mage_Sales_Model_Recurring_Profile $profile, $bool = true)
 {
     $additional = $profile->getAdditionalInfo();
     switch (true) {
         // Maximum Payment Failures <= 0 or = null -> run forever
         case (int) $profile->getSuspensionThreshold() <= 0:
             break;
             // Maximum Payment Failures > 0 -> save countFailures into additional Info
             // if countFailures = 0 -> profile is suspended
         // Maximum Payment Failures > 0 -> save countFailures into additional Info
         // if countFailures = 0 -> profile is suspended
         case $profile->getSuspensionThreshold() && !isset($additional['paymentFailures']):
             $additional['paymentFailures'] = (int) $profile->getSuspensionThreshold() - 1;
             $profile->setAdditionalInfo($additional);
             $profile->save();
             if ($additional['paymentFailures'] == 0) {
                 $profile->suspend();
                 $bool = false;
             }
             break;
             // Maximum Payment Failures > 0 -> save countFailures into additional Info
             // if isset countFailures -> countFailures - 1
             // if countFailures = 0 -> profile is suspended
         // Maximum Payment Failures > 0 -> save countFailures into additional Info
         // if isset countFailures -> countFailures - 1
         // if countFailures = 0 -> profile is suspended
         case $profile->getSuspensionThreshold() && $additional['paymentFailures'] > 0:
             $additional['paymentFailures'] -= 1;
             $profile->setAdditionalInfo($additional);
             $profile->save();
             if ($additional['paymentFailures'] == 0) {
                 $profile->suspend();
                 $bool = false;
             }
             break;
         default:
             $profile->suspend();
             $bool = false;
             break;
     }
     return $bool;
 }