Mastercard (MA -0.38%) was trading higher Thursday as the company posted earnings that beat analysts' estimates in the fourth quarter.

Net income was down about 15% in the quarter year over year to $1.8 billion, or $1.78 per share. Analysts anticipated a steeper decline in income, but consumer spending was higher than expected.

Net revenue was down 7% in the quarter to $4.1 billion. Specifically, the drop was due to a sharp decrease in cross-border volume, which was down 29% from the previous year's quarter. This is largely a result of the decline in travel spending during the pandemic.

A man watching his stock portfolio on his phone with a laptop and TV monitor in front of him also showing stock market data

Image source: Getty Images.

However, gross dollar volume, the total amount of purchases made with Mastercard-branded cards, was up 1% year over year. Also, switched transactions fees, which cover clearing and settlement, were up 4%. These two numbers were higher than expected.

CEO Michael Miebach said: "During the quarter, we expanded key partnerships around the globe, and our acquisition of Finicity added to our Open Banking portfolio. We are encouraged by the availability of effective vaccines, and we remain focused on the innovations that will enrich the digital experience, strengthen security and trust, and enable choice through our multi-rail platform, all of which position us well for the future." 

For the full year 2020, Mastercard reported that net income was down 21% to $6.4 billion compared to 2019, while revenue was down 9% to $15.3 billion. Operating expenses were flat for the year, while the operating margin was down 4.4 basis points but was still a robust 52.8%.

Despite the difficult environment, Mastercard stock returned 19% in 2020, beating the S&P 500. The credit card company should be in good position for a solid 2021 as the pandemic and recession recede.