The Enterprise_GiftCard module's generateGiftCardAccounts()
fires off of sales_order_save_commit_after
.
This seems to be causing the gift cards to be generated even when the order isn't actually placed (due to an invalid credit card let's say).
From a quick test, I changed the observer to sales_order_place_after
and it appears to work like a charm.
I'm seeing this on EE 1.12.0.2, but I've checked the latest EE (1.13.1.0) and it uses the same observer.
UPDATE: I think maybe my actual question wasn't clear. So the question is - do you know whether this is a known issue for the EE GiftCard module? Is there any simple fix for this.
It seems like changing the Generate Gift Card Account when Order Item is
config value from Ordered to Invoiced might fix the issue. But if that's the case, it seems like there is a core bug with the Ordered value, which would be good to know.