For years, we’ve been hearing about a future in which credit cards and cash would be a thing of the past, and we’d all pay by cellphone.

Well, that future is getting a lot closer.

Google Inc. on Thursday announced its long-awaited “digital wallet,” which allows people to make purchases and get deals simply by waving their smartphones at the register.

Google

The program, which is called Google Wallet, will launch today with a field test in New York City and San Francisco. Google then expects to roll out Wallet to other locations over the summer. It will first be available with Android Nexus S 4G phones on the Sprint network. Users will be able to enter MasterCard credit cards from Citi or use a “Google Prepaid Card,” which accepts payments from other banks and card companies.

And Google will also be integrating Google Offers, its rival to daily-deal services like Groupon and LivingSocial, as well as rewards cards from participating stores. And posters and other advertisements also will eventually be embedded with technology that lets users swipe their phone over the ads to get a coupon.

Google Wallet is the latest in a series of moves leading up to a system in which most in-store payments could be made by cellphone. The technology that enables such payments, called near-field communication, involves a small, secure chip embedded within phones and already is used in some credit cards and ID badges at businesses, for example.

Google is just one of many companies interested in the potential market: Apple Inc. is widely expected to integrate NFC technology into upcoming phones. And BlackBerry maker Research In Motion Ltd. has been sparring with wireless companies like AT&T Inc. over control of the mobile-payment system on its phones.

The system is so interesting to many companies in part because of the revenue associated with mobile payments. The Journal reported in March that U.S. wireless carriers were in a tug-of-war with credit-card companies over the issue.

Google, however, says it isn’t going to take any revenue from the credit-card transactions themselves. Instead, it will be making money the old-fashioned Google way: advertising.

Google will charge based on sales from its Offers discount system, and it will be able to use data to give people more relevant ads and offers, said Stephanie Tilenius, the vice president of commerce at Google. “Assuming the consumer gives us permission we will have location data and will have transaction data to target ads to them,” she said, adding that transaction data doesn’t mean secure credit-card information. Consumers can also clear their transaction history from Google Wallet, the company says.

As far as Google is concerned, credit card payments are only the beginning.

“What else do you have in your wallet — maybe a drivers license, a health care card? Eventually you’ll be able to put everything in your Google Wallet,” Ms. Tilenius said.