Response Handler is the component of Magento payment provider gateway, that processes payment provider response. Typically, the response requires one of the following actions:
- Modify the order status
- Save information that was provided in a transaction response
- Send an email
The response handler only modifies the order state, based on the payment gateway response. It does not perform any other required actions.
Basic interface for a response handler is
\Magento\Payment\Gateway\Response\HandlerChain might be used as a basic container of response handlers, handling different parts.
Example of a simple response handler (
(the code sample is from Magento CE v2.1. Although the payment provider gateway was added in v2.0, the particular default implementation using the gateway were added in v2.1)