The payment processing company Mastercard (MA 0.30%) had a turbulent year in 2020, like most other stocks in the financial sector.

But the stock has rebounded since, and overall there seems to be a lot of excitement about the company's future. It began the year trading at $303.39 per share and recently hit $337.36, representing a gain of about 11.2%. So if you had invested $1,000 in Mastercard stock at the beginning of the year, you would now have about $1,112. You are not going to retire with that money, but you should still feel good about the gain, considering the numerous obstacles from the coronavirus pandemic.

Mastercard logo

Image source: Mastercard.

The S&P 500 index is up about 14.4% year to date, so while the stock came up short of that benchmark, it fared much better than a lot of companies in the financial sector. Additionally, I think Mastercard will likely benefit long term from the digital trends that will develop as a result of the pandemic.

Although you may think of Mastercard as a credit card company that makes loans, it does not actually extend credit, but makes money by charging fees on payment transactions made on its branded cards. The company suffered earlier in the year from reduced payment volume brought on by limited physical interaction and lockdowns all over the world.

But Mastercard is well positioned to take advantage of the shift by merchants and customers to a world that is more reliant on digital payments.