We've extended the order system to include a collection of PaymentEvents (credit card authorization, capture, etc) associated with an OrderForm. We've implemented a SetParent method to set the OrderGroupId of the PaymentEvent to the OrderGroupId of the OrderForm.
The problem comes when we call SaveAsOrder on the basket. Internally, the guid of the OrderGroup gets changed. Also, the commerce server runtime seems to call SetParent on its "internal" objects to update the OrderGroupId but it doesn't do so for the PaymentEvent object.
I had a look through the docs on extending the order system but i couldn't find a scenario that seemed to address this. Can anyone give me some guidance on how to keep the OrderGroupId in sync
Thanks,
Michael.
EDIT: i had a look at the Virtual Gift Certificate example but i think we've followed all those steps.

Extending the order system : problem with OrderGroupId
zensunni