Global Payments Inc. and Total System Services Inc. agreed to combine in an all-stock transaction valued at roughly $21.5 billion, the latest in a string of deals involving large financial technology firms.

Under the agreement, shareholders of Total System Services, which is known as TSYS, will receive 0.8101 of Global Payments shares for each of TSYS’s stock, which equates to about $119.86 apiece. This represents a 5.7% premium from TSYS’s closing price on Friday.

Global...