Friend or foe?

To Visa (V) - Get Report CEO Charles Scharf, electronic payments firm PayPal (PYPL) - Get Report  is an enemy. In this growing digital marketplace, estimated to be at $8 trillion by 2020, the two companies compete for consumers who are buying products on mobile, tablets, or online. 

"If you are a foe, you're not a friend," Scharf said Monday at a technology and media conference organized by JPMorgan Chase. Visa is looking for partners to expand its network, while part of PayPal's current business model is encouraging users to take money for payments directly from their bank accounts rather than using debit or credit cards.

Currently, 50% of PayPal's transaction volume is taken directly from consumer's bank accounts, while the rest comes from cards --  with Visa accounting for about half of that volume, Scharf said. 

"So they drive a lot of business our way," Scharf said at the conference. "That's supposedly the friend part of it." 

The "foe part," Scharf said, is that by pushing customers to access their checking accounts directly, PayPal is cutting out Visa's role as an intermediary.

But PayPal's CEO Daniel Schulman said, everyone in the electronic payments ecosystem has a common foe -- cash.

"We all want to 'electronify' more and more payments and that's all attractive and additive to the entire ecosystem," he said in the first-quarter conference call.

Schulman highlighted that while the cost of ACH vs. debit has changed, the company is focused on providing consumers payment options. 

"We want to allow the customer to have the choice of whatever funding instrument they want," PayPal Chief Financial Officer John Rainey said at a conference in February. "Everything we do is very much aligned with that and that's aligned in Visa's best interest, too."

After its spinoff from eBay (EBAY) - Get Report  in 2014, San Jose-based PayPal introduced new products like PayPal Commerce, designed to help retailers sell their products in "emails, blogs, articles, apps and social shares," according to the company's website.

And One Touch, PayPal's single touch digital payment system that launched across the internet and mobile, is available to merchants in 144 markets (including Asia, Europe and Central America) and consumers in 203 markets. The online payment processor said it has 184 million customers and 14 million merchant accounts and saw a 29% increase in its payment volume, to $81 billion. 

"One Touch is the most rapidly adopted product PayPal has ever launched," Schulman said on the first-quarter conference call, noting that the product now has 21 million consumers using the product with an additional 2 million anticipated by year-end.

At the San Francisco-based company, the digital online payment service Visa Checkout, is accepted at about 250,000 merchants, which have the potential to handle $113 billion in digital transactions, the company said. Visa Checkout has nearly 12 million registered users in 16 countries; France, India and the United Kingdom will have access to it by year-end.

But despite the talks of partnership, Scharf didn't go as far to threaten PayPal, but said that Visa is moving "full steam" ahead and while it has never targeted PayPal in the marketplace in any "meaningful way," it is ready to compete in ways "people have never seen before." 

"Ultimately, if we are growing our share of digital commerce, that's the way we'll view success," he said, while noting that Visa Checkout doesn't have to be the company's only successful digital solution. 

As the segment heats up for who will gain market share, Scharf said one of the biggest issues is how to balance competition and partnerships. In February, Visa launched the Visa Developer platform, which will allow developers to use its payment-processing technology and application interfaces, or API, to test new ideas for their respective companies. 

"We have to play the role of allowing -- whether it's our own clients using those APIs or third parties using those APIs -- them to dream, to think about things they can create for their clients, that they know better than we do," Scharf said. 

With this type of technological changes happening over the next few years, it can be expected that there may be some unfriendly or friendly competition.

The digital commerce market was $4.9 trillion in 2015, according to a recent report from Juniper Research. Digital banking and remote digital and physical goods are key sectors for strong growth, the report highlighted.

"The digital commerce market as a whole is seeing an ever increasing propensity toward an omni-channel approach, and this extends to eCommerce where the mobile and tablet platform is seeing increased use toward the purchasing of physical goods, either for delivery or collection," Lauren Foye, Juniper Research author, said in a statement.

Keefe, Bruyette & Woods rates Visa an outperform with a price target of $95. Visa's share closed up 2.59% to $79.38 Tuesday, and are up 2.36% for the year. 

"We regard PayPal as a Millennial technology stock," TheStreet's Jim Cramer said. "Doesn't mean that you have to sell PayPal to own Visa."  

PayPal's shares close up 85 cents Tuesday, or 2.23% to $38.92. They are up 7.51% for the year.

EXCLUSIVE LOOK INSIDE: Visa and PayPal are all portfolio holdings of Jim Cramer's Action Alerts PLUS charitable trust . Want to be alerted before he buys or sells these stocks? Learn more now.