I getting Environment Not Set error with Authorize.Net Java SDK Version 2.0.1
"Environment not set. Set environment using setter or use overloaded method to pass appropriate environment"
Following line throws error :
CreateTransactionController transactionController = new CreateTransactionController(apiRequest)
Although I confirmed using debug point that environment was set properly.
ApiOperationBase.setEnvironment(Environment.SANDBOX);
Strangely enough, this happened when I copied the implementation code to Microservice from earlier Monolith implementation of my project. ( Same code is working on previous application)
You can also find the reported bug below for same issue back in 2015. Although it was closed as the person who raised it used an alternative solution.
https://github.com/AuthorizeNet/sdk-java/issues/74
Anyone have any clue?