Legislation to rein in credit card practices and eliminate sudden rate hikes and late fees that have entangled millions of American consumers is getting closer to becoming law, bolstered by presidential pressure and the backdrop of economic calamity.