How to set the environment? And how to rectify this error?
Fatal error: Uncaught exception 'Braintree_Exception_Configuration'
Message is pretty selfexplanatory. You need to call
Braintree_Configuration::environment(...);
with proper parameter prior using BT, as it needs to know if you want to talk to production or sandbox.