I’m not sure what search you did, but if you search this forum for “credit cards,” you’ll find the following answer:
Accounting for Credit Cards - #2 by Brucanna