Completed ecommerce orders are also showing as abandoned cart

Hello
I am developing a piwik plugin for ecommerce tracking.

All my completed ecommerce orders are also showing as abandoned cart .

The setTokenAuth and setIp is done
The addEcommerceItem() and doTrackEcommerceOrder() is done when receiving the IPN.

I noticed that the ID of the visitor is different, when recording the items for the cart, or when recording the items from the order.
Any tips to help me ?