When you setup the store order summary you should be using the session variable as the reference id value. This server behavior should store the id for the inserted order into a session variable. You should use this session variable as the detailOrderID in the store order details server behavior.
If you have any more questions about this or need more explanation of any part let us know.