Inflation is at a 40-year high, and this morning, the U.S. Bureau of Economic Analysis said that gross domestic product (GDP) declined by 0.9% in the second quarter of the year. That's after GDP declined by 1.6% in the first quarter of the year. Two straight quarters of negative economic growth is considered a technical recession. But one counterpoint to the economic stress is Mastercard's (MA 1.33%) recent second-quarter report, which came in strong and showed that the consumer has not only held up but stayed strong as well. Let's take a look.

Consumer spending and travel remains strong 

Gross dollar volume across Mastercard's huge payments network jumped 14% year over year to $2.1 trillion.

The uptick was driven by a surge in cross-border volume, which jumped 58% year over year, and is now at 139% of 2019 levels. Switched payment volume in the U.S. is now at 146% of 2019 levels and 162% higher outside of the U.S.

Person smiling while sitting in front of laptop.

Image source: Getty Images.

As a result, Mastercard generated diluted earnings per share of $2.34 on total revenue of $5.5 billion for the second quarter, which are up 21% and 13%, respectively, on a year-over-year basis. Both numbers topped analysts' expectations.

The beat isn't a big surprise after Visa, Mastercard's main rival, reported similar results earlier this week, and with most large banks reporting strong consumer spending in the second quarter of the year. 

Mastercard CEO Michael Miebach said on the company's earnings call today that management is certainly aware of the macro challenges -- including inflation, rising interest rates, geopolitical, and supply chain issues -- but they really haven't cut into the business yet.

"Despite this, unemployment rates remain low, wages are rising and consumer savings levels remain high. With this backdrop, consumer spending and particularly travel-related spending remains strong," Miebach said.

Mastercard also raised its revenue guidance and now expects full-year revenue to grow at a percentage in the low 20s compared to the previous year. This is also happening despite the fact Mastercard is ending its Russian operations, which will cut into revenue.

Continued strength into Q3

Mastercard has also seen its business ramp up through the first three weeks of July, showing no signs of weakness, with total cross-border volume now up 140% over 2019 levels. Cross-border travel volume, which ended Q2 118% over 2019 levels, is now up 126% over 2019 levels through the first few weeks of July.

One thing to consider is that not all of this is happening in the U.S.. Mastercard CFO Sachin Mehra said the Asia Pacific region has really struggled from a cross-border perspective up until recently and now these markets have started to open and Mehra thinks there is room to grow.

In terms of spending among different income classes, Mehra said there has been a decline in terms of spending growth among lower-income consumers in the U.S., while outside the U.S. spending seems pretty healthy among all income groups. 

How would Mastercard fare in a recession?

Clearly, the U.S. economy is in a very different situation than the past, considering the U.S. is in a technical recession but still has healthy levels of consumer spending and a very healthy labor market. I think everyone is watching to see if things deteriorate from here, but it may also not happen. Just because Mastercard sees the pace of spending slowing among lower-income consumers in the U.S., it could be reverting back to pre-pandemic levels as opposed to a drop-off or deterioration due to a severe recession.

From a business perspective, I have plenty of confidence in Mastercard through a range of scenarios. In terms of inflation, the payments network can serve as a hedge because as prices go up, Mastercard will collect more in fees. 

Also, Mastercard has lots of geographic and sector diversity, so different parts of the world and different industries could be in different stages at different times. Just because one part of the world is slowing, another part could still be healthy, as seen in the Asia Pacific region. 

Finally, Mastercard is battle-tested. The company has one of the largest payment rails in the world, operates in an industry with high barriers to entry, and actually grew revenue and earnings during the Great Recession. I think the company is well positioned to deal with whatever comes its way.