The gateway sent two payment confirmations. How do you check Magento 2 automatic invoicing?

1 min read

Two silver discs with teal details and one sheet in a metal tray

Two notifications may refer to the same payment transaction. Match their timestamps and IDs with the order, Magento invoices and the transaction status at the gateway.

Check what triggers Auto Invoice

Version 1.0.4 listens for checkout_submit_all_after. The payment integration handles gateway notifications, so check whether it also emits an event the module listens for. The timeline shows a sequential run with a test invoice service. Auto Invoice documentation.

Local test timeline
TimeEventGateway transaction IDOutcome in Magento
09:00checkout_submit_all_after—Creates INV-17 for 2 units
09:01Notification 1PAY-17Still 1 invoice
09:02Notification 2PAY-17Still 1 invoice
09:03checkout_submit_all_after—Replay, no quantity left to invoice

Check invoice numbers and line quantities

In the test, the first run created INV-17 for two units. A replay for the same order stopped at canInvoice() once no quantity remained. For a real order, compare the invoice IDs and the quantities on each line. Magento supports partial invoices. Invoices in Adobe Commerce.

Reconcile transactions and the ERP document

Check transaction IDs, types, amounts and currency in Magento and at the gateway. The module requests an invoice with capture=false. In the ERP, separately verify the document reference linked to the order. If the notifications arrived in parallel, reproduce that timing on a test deployment of the integration. Transactions in Adobe Commerce.

Kowal Auto Invoice · Conditions for automatic Magento 2 invoicing.

Previous Next

KOWAL.BLOG

Choose your language

Available versions open the corresponding page. More languages are being prepared.

English (UK) Français Deutsch Español Italiano Português Nederlands Svenska Dansk Norsk Suomi Lietuvių Latviešu Eesti Čeština Slovenčina Magyar Română Български Ελληνικά Slovenščina Hrvatski Polski English (US)