Paypal express checkout invokes "checkout_complete" workflow-ng event twice

Posts: 12
Joined: 07/26/2008

The function uc_cart_complete_sale is called twice, and therefore the "checkout_complete" workflow event is invoked twice. Which decreases inventory each time.

I believe it is because uc_cart_checkout_complete is called first as a callback from the URL /cart/checkout/complete, which then calls uc_cart_complete_sale.

Then uc_cart_complete_sale is called directly from uc_paypal_ipn (around line 659) when the Instant Payment Notification comes through.

This is a big problem since inventory gets decreased twice, and any other events triggered by checkout_complete (referral bonuses) also happens twice.

I solved this quick and dirty by removing the latter call, but it doesn't seem ideal.

Posts: 18
Joined: 08/05/2008

I stumbled across a similar issue over at
http://www.ubercart.org/forum/support/6887/checkout_confirmation_emails_...

As my module is based on the 2checkout module, it may be an issue there too.

You can see my approach to solving the issue there.

Alan