Visa (V -1.54%) has turned out to be a great investment historically. The stock has soared 1,850% since its initial public offering (IPO) in 2008. That gain would've turned a $10,000 investment into almost $200,000 today.

Seeing this, investors might be looking at ways to gain exposure to the payments industry. A valid argument could be made that Visa, with a $560 billion market cap and a price-to-earnings (P/E) ratio of 30.6, could appear like an expensive stock today.

But don't worry. If you missed out on Visa, maybe buying PayPal (PYPL -0.58%) is a smart move.

Visa is a superb business

There is no shortage of reasons to appreciate Visa. The long-term secular trend of cashless transactions gives the business a robust tailwind to continue expanding its payment volume. And there is still a sizable runway for this to keep happening.

That favorable backdrop has resulted in steady revenue growth. Even more impressive, Visa is one of the most profitable enterprises on the face of the planet. In the past five years, its operating margin has averaged an amazing 66.3%.

Visa has unrivaled scale, as exemplified by its 4.4 billion cards in circulation and 130 million merchant-acceptance locations. This results in powerful network effects. Couple this with the fact that it's a mission-critical business for the smooth functioning of commerce around the world, and I have confidence that Visa is not going to be disrupted anytime soon.

PayPal presents a buying opportunity

PayPal benefits from the same secular story that Visa does, which is the growth of digital payments. This business has been at the forefront of this trend for more than two decades. But PayPal also gains from the rising acceptance of online shopping, as this is a top payment service for that particular setting.

Like Visa, this business also possesses network effects. It has 427 million active accounts, consisting of both merchants and consumers, that help create its global two-sided payment platform. As merchants join, PayPal becomes more valuable to consumers looking for broad selection. The flip side is also true, with more consumers making PayPal a valuable service to merchants looking for a large customer base.

This is a company that continues to post healthy financial results. Total payment volume and revenue rose 14% and 9%, respectively, in the first quarter. And after generating $4.2 billion in free cash flow (what's left of cash flow after capital expenditures) last year, executives expect to make $5 billion in 2024.

While PayPal's active account base has been little changed in the past couple of years, engagement is on the way up. The average account transacted 60 times on the PayPal platform in the past 12 months, up from 53.1 a year ago.

In the six years after PayPal's spin-off from eBay, the shares skyrocketed. But slower growth, particularly following the pandemic boom, has damped investor sentiment. I also believe that the market is worried about just how intense the competitive landscape is. Other popular digital wallets, like Apple Pay or Block's Cash App, only make it more difficult for PayPal to stand out.

Nonetheless, the shares have gotten too cheap to ignore. They're off as much as 81% from their peak, and they currently trade at a P/E of 14.7. That's less than half the P/E of Visa. Investors looking to buy a competitively advantaged, profitable, and growing business need to take a closer look at PayPal.

Of course, there is more uncertainty surrounding this company as we look out over the next five years than there is with Visa. But I think the beaten-down valuation more than demonstrates the heightened pessimism with PayPal. And as the business continues increase revenue and net income, the stock should do well.