One caution, beware the impact on your FICO score if you close out the accounts. Depending on what else you already have in your credit report, and how many other cards you have, you might be better off keeping the accounts open (or maybe just one of them) to maintain your credit history, even if you don’t plan on using them. (Provided of course you’re not worried about the temptation to spend and rack up more $$ if you leave them open).
From experience, I would (now) close the account first and then pay them off, unless you are very disciplined. I say that because I paid off a card 2 months ago thinking I would shred it and call and close it but a couple weeks later, due to very good procrastination on my part, I used it again thinking I really ‘needed’ what I charged. So…now here I am with that stupid card bill all over again!