I installed a custom extension for my Magento 2.3 payment gateway, then i want to process the order payment in another extension, then i come across this code within the extension:

   <virtualType name="VendorModuleGatewayCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
        <argument name="commands" xsi:type="array">
            <item name="capture" xsi:type="string">VendorModuleCaptureCommand</item>
            <item name="settlement" xsi:type="string">VendorModuleSettleCommand</item>
            <item name="sale" xsi:type="string">VendorModuleSettleCommand</item>
            <item name="void" xsi:type="string">VendorModuleVoidCommand</item>
            <item name="retrieve_status" xsi:type="string">Vendor\Module\Gateway\Command\RetrieveStatus</item>
            <item name="cancel" xsi:type="string">VendorModuleCancelCommand</item>
            <item name="refund_later" xsi:type="string">VendorModuleRefundCommand</item>
            <item name="refund" xsi:type="string">VendorModuleRefundCommand</item>

I'm a little bit confused when I analyzed the above code in Vendor/Module/etc/di.xml , is it correct the above code related to \Magento\Sales\Model\Order\Payment, because when I ran $payment->void() it triggers the extension void function somewhere in the code, but when I called $payment->retrieve_status() it said undefined function. Is my understanding for this code correct? or perhaps i missed something?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.