How Freshy resolved WooCommerce order failures caused by Link Money webhook conflicts
A recurring issue was causing paid WooCommerce orders to revert to “Failed” status after successful payment—disrupting fulfillment and confusing customers. Freshy’s developers discovered the cause was tied to duplicate webhook callbacks from the Link Money payment gateway, overwriting correct statuses even after successful credit card payments. This case study explains how the Freshy team diagnosed, tested, and implemented a robust fix that restored order integrity.
Issue background
The client reported that customers who initially attempted checkout using Link Money but later completed payment via another method (such as a credit card) were having their orders incorrectly marked as “Failed.”
Here’s what was happening:
- A customer started checkout with Link Money, but the payment failed.
- The same customer then paid successfully using another gateway (credit card).
- Despite the successful transaction, the Link Money webhook continued to send asynchronous “payment failed” callbacks for the original attempt.
- Each callback overwrote the order’s “Processing” status, reverting it to “Failed.”
The result:
- Paid orders were incorrectly flagged as failed.
- Shipments were delayed or withheld.
- Customer service had to manually review and correct orders.
This issue posed a serious risk to customer trust and fulfillment reliability.
Diagnosis
Freshy’s development team reviewed both the WooCommerce logs and webhook call history. Their analysis revealed:
- The Link Money webhook did not check whether the order had already been successfully paid via another method before updating its status.
- The webhook handler in the Link Money plugin lacked conditional logic to verify the order’s current payment state.
Essentially, the webhook was applying a blanket “Failed” status update without validating the existing order context.
Resolution steps
- Reproduced the issue in staging
Freshy’s developers replicated the full payment flow on a staging environment to confirm the behavior:- Initiated checkout with a failed Link Money payment.
- Completed the same order using a credit card.
- Verified that the Link Money webhook still sent “failed” callbacks that reverted the order.
- Tested updated Link Money plugin version
The team obtained the latest version of the Link Money WooCommerce plugin and installed it on the staging site. After testing, they confirmed that version 1.1.1 addressed parts of the issue but required additional validation logic to ensure protection against duplicate webhook calls. - Implemented webhook logic safeguard
Freshy added a conditional check to the webhook handler to ignore Link Money callbacks once an order was already paid via another method.
// Ignore Link Money webhook if order already paid by another method
if ( $order->get_payment_method() !== 'linkmoney' && $order->is_paid() ) {
$order->add_order_note( 'Link Money webhook ignored – order already marked as paid by another method.' );
return;
}
This safeguard ensures the webhook cannot overwrite a valid “Processing” or “Completed” status.
- Verified end-to-end functionality
After implementing the fix:- The team ran multiple failure→success payment scenarios.
- Orders paid with alternate gateways remained correctly marked as “Processing.”
- The Link Money webhook correctly ignored irrelevant callbacks.
- Monitored post-deployment results
Once deployed to the live site, Freshy continued monitoring order behavior and WooCommerce logs. No further webhook-induced status reversions occurred.
Final outcome
With this fix in place:
- Paid orders remain accurately marked as Processing or Completed, even if older webhook messages arrive later.
- Customer service teams no longer need to manually correct failed orders.
- Order fulfillment and reporting now operate without disruption.
The solution also improves long-term traceability—each ignored webhook is logged with a clear note in the order history.
Key takeaway
Webhook-based payment gateways can introduce race conditions when multiple payment methods are used for a single order. Freshy’s fix ensured that webhook callbacks respect WooCommerce’s internal payment state, preventing inaccurate status updates and avoiding lost revenue opportunities.
Need help resolving payment gateway or webhook issues in WooCommerce?
Contact Freshy today to ensure your checkout workflows, gateways, and order systems stay perfectly synchronized.