There are two basic approaches, which a business can utilize, if it needs to integrate a terminal application into its payments ecosystem. Either it can use a standalone terminal solution, or an integrated terminal solution.
In a standalone terminal solution the POS application does not interact with the terminal application in any way when the payments are made, i.e. the terminal functions independently and interacts directly with the payment gateway.
If a company needs to have more control of the terminal when the sales are made, it needs to choose some way of integration with the terminal. Integrated solutions can be divided into semi-integrated and fully integrated ones. In fully integrated solutions all communication between the terminal and the payment gateway is conducted through the POS system, while the terminal just reads the information from the card. In semi-integrated solutions the terminal also formats the payment information into a message and sends it to the payment gateway or processor.
Integration itself can be done either through an SDK, or through a REST API. Sometimes, a so-called non-integrated approach is used. Under this approach the terminal application independently interacts with the payment gateway software, but the payment gateway informs the POS system about payments made right after their authorization.
More information on different terminal application integration methods can be found in the respective article on Paylosophy.