Fatal error: Uncaught exception 'Braintree_Exception_Configuration' with message 'environment needs to be set.'

Fatal error: Uncaught exception 'Braintree_Exception_Configuration' with message 'environment needs to be set.'

如何设置环境?以及如何纠正这个错误?

Fatal error: Uncaught exception 'Braintree_Exception_Configuration'

消息非常不言自明。您需要致电

Braintree_Configuration::environment(...);

在使用 BT 之前使用适当的参数,因为它需要知道您是想与生产环境还是沙箱对话。