How is Magento\Payment\Model\Method\Substitution implemented and used?

Implementation

Usages

1. Magento\Sales\Model\Order\Payment\Info::getMethodInstance()

2. Magento\Payment\Model\Info::getMethodInstance() (is is just a copy/paste of the method above, an example of the «nice» Magento 2 architecture)

3. Magento\Quote\Model\Quote\Payment\ToOrderPayment::convert()

4. Magento\Payment\Model\PaymentMethodList::getList()

5. Magento_Payment/etc/config.xml

6. Magento\Payment\Block\Info\Substitution