We built an application to do exactly what you described in your post. We found basing cancelation rules on the number of payment failures a bit restricting and have since update our application to use days past 'invoice due date' to determine when to cancel the subscription and writeoff the invoice. Once an unpaid invoice exceeds the threshold of past due days we use a couple of different account level attributes such as batch number, net terms or auto pay flag to determine how to treat the subscription. To give our collections team some flexibility we added a custom field on the account and invoice that allows us to extend the unpaid period or exclude the account from cancelation logic on a case by case basis. Switching to 'days past due' allows us to manage different payment failure rules for multiple products billing on the same account. Of course this would all work better if payment attribute were at the product level instead of account level... hopefully we'll see that change by the end of the year.
... View more