I'm working on a shipping module. In system.xml
I set some fields to be backend_encrypted
. Here is the node:
<client_id translate="label"> <label>Client ID</label> <frontend_type>obscure</frontend_type> <backend_model>adminhtml/system_config_backend_encrypted</backend_model> <sort_order>10</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>0</show_in_store> </client_id>
I need that value to pass using cURL to shipping API but, when I try to retrieve it using $this->getConfigData('client_id');
, it come out encrypted.
I was looking in other modules and I see values stored the same but somehow, they manage to get the right value.
Any idea how to get it?
In order to use $this->getConfigData('client_id');
without manually decrypting it, you need to update your config.xml by adding <client_id backend_model="adminhtml/system_config_backend_encrypted" />
, see example below
In your config.xml
... <default> <carriers> <magepal> ...... <client_id backend_model="adminhtml/system_config_backend_encrypted" /> </magepal> </carriers> </default> </config>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With