The fast-food giant will roll out mobile smartphone ordering and payment functionality to all 14,000 domestic restaurants by the fourth quarter of 2017. Image: Daniel Acker, Bloomberg, Getty Images

Investors should buy McDonald's shares because it will be the first major fast-food chain to have mobile order and pay functionality for all its U.S. restaurants, according to Wells Fargo, which raised its rating on the stock to outperform from market perform.

"Restaurant consumers are aggressively gravitating toward concepts that offer the greatest level of convenience and control across ordering, payment and distribution," analyst Jeff Farmer wrote in a note to clients Monday. "Among the hamburger players, we believe that MCD is establishing a first-mover advantage with digital that can drive sustainable share gains in late 2017 and beyond."

Farmer cited how the fast-food giant will roll out mobile smartphone ordering and payment functionality to all 14,000 domestic restaurants by the fourth quarter of 2017. In addition, the company plans to install digital ordering kiosks in 2,500 stores by year-end, according to the analyst.

"Wendy's is closest in its own roll out timeline and expects to offer mobile order & pay across half of its system by the end of 2017, while Burger King and Jack in the Box are in test," the note said.

As a result, he raised his McDonald's valuation range to $145 to $150 from $125 to $130, representing 13 percent upside at the midpoint from Thursday's close.

"We believe that MCD will see a multi-year market share tailwind driven by … the company's marketing muscle and scale in communicating the concept's advancements in customer convenience and control," he wrote.