I think this is unexpected behavior: I work in a mixed environment both using Mollie API keys and OAuth - when calling setAccessToken I think the wrapper should ignore the mollie.key-config / MOLLIE_KEY-env setting.
I would propose to remove the calling of setApiKey() from the construct-function.
#
The primary benefit of this wrapper is that the auth config is wired up and ready to go. If you need switching on the fly between keys and tokens etc using the mollie-api-php sdk directly is a better choice.
OAuth authentication fails when MOLLIE_KEY env is set, because the constructor of the MollieApiWrapper invokes setApiKey:
$this->setApiKey($this->config->get('mollie.key'));
I think this is unexpected behavior: I work in a mixed environment both using Mollie API keys and OAuth - when calling setAccessToken I think the wrapper should ignore the mollie.key-config / MOLLIE_KEY-env setting.
I would propose to remove the calling of setApiKey() from the construct-function. #