Three giant credit card companies recently were ordered to refund millions of dollars to customers because, regulators said, they had deceived consumers.

I say shame on the credit card companies and kudos to the regulators.

For consumers, there are valuable lessons to be learned from the three cases. First, a little background:

In July, in its first public enforcement action, the federal Consumer Financial Protection Bureau ordered Capital One Bank to refund about $140 million to 2 million customers and pay an additional $25 million penalty.

Regulators said Capital One’s vendors used “deceptive marketing tactics” to pressure or mislead consumers into paying for “add-on products” when they activated their cards, such as payment protection and credit monitoring.

“We are accountable for the actions that vendors take on our behalf,” said Ryan Schneider, president of Capital One’s card business. “These marketing calls were inconsistent with the explicit instructions we provided to agents for how these products should be sold. We apologize to those customers who were impacted and we are committed to making it right.”

In September, the Federal Deposit Insurance Corp. and the consumer bureau ordered Discover Bank to refund about $200 million to more than 3.5 million consumers and pay a $14 million civil penalty.

“Discover’s telemarketing scripts contained misleading language likely to deceive consumers about whether they were actually purchasing a product,” the agencies said. “Discover’s telemarketers also often downplayed key terms and spoke quickly during the part of the call in which the prices and terms of the add-on products were disclosed.”

As a result, consumers believed they didn’t have to pay for the products, were misled about whether they had purchased the products and were enrolled without their consent, regulators said.

“We have worked hard to earn the loyalty of our card members, and we are committed to marketing our products responsibly,” said David Nelms, chairman and chief executive of Discover. “As always, we will continue to strive to deliver the highest standards of customer service and satisfaction.”

Last Monday, the consumer bureau ordered three American Express subsidiaries to refund an estimated $85 million to about 250,000 consumers for illegal card practices.

Regulators said the subsidiaries charged unlawful late fees, discriminated against new account applicants on the basis of age, failed to report consumer disputes to credit bureaus and misled consumers about debt collection.

“Several American Express companies violated consumer protection laws and those laws were violated at all stages of the game — from the moment a consumer shopped for a card to the moment the consumer got a phone call about long-overdue debt,” said CFPB Director Richard Cordray.

American Express, which didn’t admit any wrongdoing, agreed to pay fines totaling $27.5 million to a variety of regulatory agencies.

“We worked closely with the regulators and cooperated fully with them throughout their reviews,” said Marina Hoffmann Norville, an American Express spokeswoman. “We took responsibility for correcting the issues and are compensating customers where appropriate.”

So what lessons can consumers learn from these cases?

First, be careful about buying something over the phone.

“You can hear the person’s presentation, but you should never agree to anything on the phone because sometimes you act out of impulse,” said Bill Hardekopf, chief executive of LowCards.com. “You never know if it’s a scam.”

Second, always ask for terms and conditions in writing. This is especially important when it concerns something for which you will be financially obligated.

Third, if you’re tempted to buy payment protection products, think about this for a minute:

“You’re basically betting that you’re going to lose your job,” said John Ulzheimer, president of consumer education at SmartCredit.com.

“You could do so much better for your balances if you’ll take any amount of money that you’re adding to your balance in the form of payment insurance and just apply it to the balance of the account,” he said.

The final lesson: Don’t forget that a telemarketer’s job is selling a product — but you don’t have to buy it.