For Twitter and Facebook, the two principal combatants in the world of social media, e-commerce is emerging as the newest battleground.

Twitter announced in a blog post on Thursday that it had agreed to acquire CardSpring, a mobile payments infrastructure company that allows merchants to offer deals to consumers that can be loaded onto to their credit cards. When the card is used to pay at the store, the coupon is automatically applied.

Photo

For Twitter, a microblogging service based on 140-character messages, the potential uses are obvious: If you see a retailer’s tweet promoting a particular product and want to get the deal, you might soon be able to click a button or send a reply to simply add the discount to a stored credit card — without leaving Twitter’s site or firing up another app. For the last couple of years, Twitter and American Express have offered AmEx cardholders the ability to load various discounts onto their cards through tweets.

The next logical step would be to allow users to click to buy a product, an idea that Twitter is also exploring, potentially with the payment processing company Stripe. A Twitter spokesman declined to comment on the imminence of a buy button, but in its blog post about CardSpring, the company teased, “We’ll have more information on our commerce direction in the future.”

Facebook, meanwhile, isn’t waiting. The company said on Thursday that it was testing a buy button on its desktop site and its mobile app.

Photo

Initially limited to a tiny number of small and medium-size merchants, the test will allow Facebook users to buy a product directly from a post. Once users click on the buy button, a dialog box will pop up that prompts them for their payment information and shipping address. Facebook will then transfer the credit card information to a third-party payments processor and tell the merchant the details of the order so it can be fulfilled. The company said the financial information will be transmitted securely and users don’t have to save any credit card data on its site.

Facebook declined to identify the initial merchants involved, although Modify Watches, a company in San Francisco that makes casual watches, is featured in Facebook’s blog post announcing the test and is already offering two watches for sale through the service.

Again, the idea is to simplify the buying process and keep people on Facebook instead of forcing them to go to another app or site to make the purchase. Facebook, the world’s largest social network with nearly 1.3 billion users, operates its own payments service, which is used mostly for the purchase of virtual goods inside games that run on the Facebook platform. But the company has long been interested in how to extend that ease of purchasing to more conventional goods and services.

An easy-to-use e-commerce offering from one or both companies would make their platforms more appealing to advertisers that are seeking to capture impulse buyers as they scroll idly through their feeds of tweets or status updates.