That is robust, but a bit more complex and extensive from what I've implemented...
On the purchase ProForm I set the
ccaps attribute with the corresponding role level they're purchasing -- so when a user registers and submits their initial payment it stores their level:
[s2Member-Pro-AuthNet-Form level="4" ccaps="level4"...
If they're demoted down to Level0 via transaction failure/credit card expiration, it's as simple as checking their ccap for what their account was originally. Using
s2If it displays the correct ProForm to either show Billing Modification Form, or Update Form:
[s2If current_user_can(access_s2member_ccap_level4) AND current_user_cannot(access_s2member_level4) AND current_user_can(access_s2member_level0) ]
<!-- Level 4 user, but currently at Level 0 role - display Billing Modification ProForm -->
[s2Member-Pro-AuthNet-Form modify="1" level="4" ccaps="level4" ...]
[s2If current_user_can(access_s2member_ccap_level4) AND current_user_can(access_s2member_level4) ]
<!-- Level 4 user, and at Level 4 role - display Billing Update ProForm -->
[s2Member-Pro-AuthNet-Form update="1" desc=" " accept="visa,mastercard,amex,discover" default_country_code="US" captcha="0" /]