I'd like to customize the "Checkout Success" message based on several variables, but don't know what the variables are called or where they are set.

Basically, I'd like to know if there were any digital products in the order, any non-digital products, and what the current status for the order is (pending, processing, etc).

Is this something that would be easy to do if I knew how the variables were stored, or would I have to write/edit 50+ lines of code?