This is a bit of misunderstanding of history. He started X.com which would later become PayPal.
To be even more precise, X.com merged with Thiel's Confinity, which already had a product called PayPal, and later the whole company was renamed after the latter. PayPal existed as a thing before Musk's involvement.
oh, and musk was fired for incompetence, and all his code thrown away after the x.com acquisition. he also isn't the founder of Tesla. basically everything "everyone knows" about Elon "monorail" Musk, is a lie.