<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="TbiBank\FusionPay\Block\Adminhtml\ButtonFieldRenderer" />
    <type name="Magento\Payment\Model\Method\AbstractMethod">
        <plugin name="tbibank_fusionpay_payment_method_visibility" type="TbiBank\FusionPay\Plugin\PaymentMethodVisibility" sortOrder="10" disabled="false"/>
    </type>
    <type name="TbiBank\FusionPay\Logger\FusionPayLogger">
        <arguments>
            <argument name="name" xsi:type="string">TBIBANK_FUSIONPAY</argument>
            <argument name="handlers" xsi:type="array">
                <item name="fusionPayHandler" xsi:type="object">TbiBank\FusionPay\Logger\Handler</item>
            </argument>
        </arguments>
    </type>
    <type name="TbiBank\FusionPay\Logger\Handler">
        <arguments>
            <argument name="fileName" xsi:type="string">/var/log/tbibank_fusionpay.log</argument>
            <argument name="loggerType" xsi:type="const">Monolog\Logger::INFO</argument>
        </arguments>
    </type>
    <type name="Magento\Framework\App\Helper\AbstractHelper">
        <plugin name="fusion_pay_product_helper" type="TbiBank\FusionPay\Helper\ProductHelper"/>
    </type>



    <type name="Magento\Setup\Console\Command\ModuleDisableCommand">
        <plugin name="fusionpay_module_disable_plugin"
            type="TbiBank\FusionPay\Plugin\ModuleDisablePlugin"
            sortOrder="1"
            disabled="false"/>
    </type>

    <!--
        Feed tbi_status into Magento's native sales_order_grid synchronisation so the
        denormalized grid column is maintained by the platform itself, instead of by a
        runtime JOIN (the removed AddTbiStatusToOrderGridCollection plugin) or by
        module code alone. Partner review item 3.
    -->
    <virtualType name="Magento\Sales\Model\ResourceModel\Order\Grid">
        <arguments>
            <argument name="columns" xsi:type="array">
                <item name="tbi_status" xsi:type="string">sales_order.tbi_status</item>
                <item name="tbi_contract_id" xsi:type="string">sales_order.tbi_contract_id</item>
            </argument>
        </arguments>
    </virtualType>

    <type name="Magento\Cron\Model\Schedule">
        <arguments>
            <argument name="jobCode" xsi:type="string">fusionpay_module_status_checker</argument>
        </arguments>
    </type>



</config>
