When “Capture Immediately” Still Caused a Second Payment in D365 Commerce
During our D365 Commerce implementation, we enabled immediate capture in Adyen expecting it to solve the usual authorization versus capture risk.
And technically, it did.
The customer placed the order.
Adyen authorized the card.
The payment was captured immediately.
Money was already received.
So far, everything looked good.
But then came the real problem.
Some orders were not invoiced immediately. They stayed open for longer than expected due to fulfillment delays, business process timing, or operational backlog. In our case, once the order crossed the card/payment validity window, such as 14 or 21 days depending on the card issuer or payment setup, the system behaved unexpectedly during invoicing.
Even though the customer payment was already captured earlier, when the sales order invoice was posted later, D365 Commerce attempted payment processing again.
That meant the customer could be charged again at invoice posting.
This was the real fire drill.
The Misunderstanding: Immediate Capture Does Not Automatically Protect the Full Order Lifecycle
At first glance, immediate capture feels like the safest setup.
You assume:
“Payment is captured, so the order is paid.”
But in a D365 Commerce flow, payment status, invoice posting, card references, payment connector behavior, and settlement logic all need to remain aligned until the order is financially closed.
If the order stays uninvoiced for too long, the system may no longer treat the original payment reference as valid for the final invoice process. So instead of simply settling against the already captured payment, it may initiate another payment action.
That is where the second deduction risk appears.
Why This Happens
This issue sits between payment configuration and business process timing.
The key points are:
- The original customer payment was captured immediately.
- The sales order remained open beyond the expected payment validity period.
- The invoice was posted after that period had passed.
- During invoice posting, D365 Commerce attempted to process payment again instead of using the already captured transaction cleanly.
- The customer saw another deduction or payment attempt.
So the problem was not that payment was never captured.
The problem was that the order lifecycle outlived the safe payment processing window.
The Business Lesson
This is where I had to explain to the business that payment configuration alone cannot fix delayed order processing.
If the order is paid today, but invoicing happens after 14 or 21 days, the system can behave differently depending on the payment connector, card issuer rules, and Commerce payment handling.
So the business has two choices.
Option 1: Change the Process
Complete the order lifecycle within the safe payment validity period.
This means:
Invoice within the allowed timeframe.
Avoid keeping paid Commerce orders open for too long.
Monitor delayed orders.
Prioritize paid but uninvoiced orders.
Define escalation rules before the payment window expires.
This is the cleanest option if the business can control fulfillment timing.
Option 2: Build a Controlled Custom Solution
If the business cannot guarantee invoicing within the timeframe, then a customization may be required.
The solution should prevent duplicate customer charging by checking whether the payment has already been captured before invoice posting.
A good design can include:
Validation of original payment capture status.
A check against Adyen transaction reference.
A warning before invoicing old Commerce orders.
A custom settlement logic to link the invoice with the already captured payment.
A prevention mechanism so the system does not trigger a second payment.
A monitoring report for paid orders not invoiced within the safe window.
That is the route we had to think through, because business reality does not always follow ideal payment timelines.
What I Would Test Next Time
I would never again test only same-day invoicing.
For Commerce payment testing, I would test:
Order placed and invoiced same day.
Order placed and invoiced after several days.
Order placed and invoiced after 14 days.
Order placed and invoiced after 21 days.
Immediate capture enabled.
Delayed capture enabled.
Cancelled orders after capture.
Partial fulfillment after capture.
Backorders after capture.
Duplicate payment prevention.
Adyen transaction reconciliation against D365 invoice posting.
Because the issue does not always appear when the payment is created.
Sometimes it appears when the invoice is posted much later.
The biggest lesson here was simple:
Immediate capture does not mean your Commerce order lifecycle is safe forever.
If the order remains open beyond the payment validity window, you may still face payment behavior that can confuse the customer and create reconciliation headaches for finance.
In D365 Commerce, payments are not just about whether the card was charged.
They are about whether the payment, order, invoice, and settlement remain aligned until the transaction is fully closed.