Payment processing is one of the most tightly regulated, and some might say corrupt, industries. Replicating the tech wouldn't be difficult. The social and regulatory part is effectively impossible for anyone who's not already in the inner circle.
Ironically Square isn’t good at anything in particular. Square fails to have a good point of sale (Toast wins) and fails for online store fronts (Shopify wins). Square is in a position where they spread themselves thin and aren’t at the top of anything in particular.
i think they dont have a great moat in their individual offerings, but across square, cash app, and afterpay they offer a pretty good suite of products for the entire transaction stack.