Guillaume Posted June 24, 2021 Share Posted June 24, 2021 Hi, In my payment gateway, for safety reasons, I would like to check the form's signature (to ensure the response is genuinely from the payment provider). For that purpose, I need to use a couple of settings which are input by the admin of the module's settings page, namely: the certificate, the mode (test or prod) and the encryption algorithm). But while a simple $mode=$this->_module['mode'] works perfectly in fixedVariables() function, it stays empty when called in call() function. I have tried the below, but with no luck: $this->_module = $GLOBALS['config']->get($module); Is there any reason why I need to specifically call the module's settings differently in that function? Best regards, Guillaume Link to comment Share on other sites More sharing options...
bsmither Posted June 24, 2021 Share Posted June 24, 2021 When the Module class (via /classes/module.class.php) instantiates a module's class, the config settings (fetched via Module) are passed into the module's class (via the module's __construct() function) and becomes the class's private attribute _module. This private class attribute _module is visible everywhere in the module's class. There is no need to fetch it again once inside the module's class. I think I see you are trying to use the variable $module that was passed in via the module's __construct() function. This variable is strictly local to that function - not visible in any other function of the class - that's why it was immediately assigned to the class's private variable $this->_module. Link to comment Share on other sites More sharing options...
Guillaume Posted July 6, 2021 Author Share Posted July 6, 2021 Sorry, I should have tried this before asking. What you describes worked perfectly indeed! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.