Magento2 结帐 returns 到购物车而不是下订单

Magento2 checkout returns to cart instead of placing order

我想为我的商店添加“payonbill”功能,所以我使用 checkmo 付款方式来实现。我添加了一个具有此配置的新模块:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
    <default>
        <payment>
            <checkmo>
                <active>1</active>
                <model>Magento\OfflinePayments\Model\Checkmo</model>
                <order_status>processing</order_status>
                <title>Check / Money order</title>
                <allowspecific>0</allowspecific>
                <group>offline</group>
                <payment_action>authorize_capture</payment_action>
            </checkmo>
        </payment>
    </default>
</config>

这样,付款状态将迁移到处理中,付款操作将被触发以进行授权。这样做时,我什至无法再使用这种方法在商店下订单。问题实际上是因为 payment_action。当我删除它时它再次工作。

有没有办法处理这种情况?当有人可以支付账单时,我也想触发事件 sales_order_invoice_pay 并继续流程。

最佳 皮姆

我通过实际删除我以前做过的事情并实施这个模块解决了这个问题:

https://github.com/dominicwatts/autoinvoice

实际问题是一切正常,但最后在管理员内部预订时,对于离线支付,发票生成了。绕过状态不会为您生成发票。