Gateway Client is a component of the Magento payment gateway that transfers the payload to the payment provider and gets the response.
The basic interface for a gateway client is
The following gateway client implementations can be used out-of-the-box:
Following is the illustration of how a Zend client can be added in
Transfer Factory allows to create transfer object with all data from request builders. This object is then used by Gateway Client to process requests to payment processor.
Transfer Factory uses Transfer Builder to set required request parameters.
The basic Transfer Factory interface is Magento\Payment\Gateway\Http\TransferFactoryInterface.
The similar example of factory might looks like this:
In this example transfer factory simply sets request data using Transfer Builder and returns the created object.
Following is an example of a more complicated behavior. Here transfer factory sets all required data to process requests using API credentials and all data is sent in JSON format.