Visa and Mastercard are close to settling with merchants to lower interchange fees and allow stores to refuse certain credit cards, aiming to end a 20-year legal dispute.