Where you say "In the store order summary, use the session ID as the cart ID and use the cartId variable from the payment response to determine which record to update."
Is the cart ID the OrderID field based on the MySql database you provide for download?