-- HikaShop version -- : 4.7.1
-- Joomla version -- : 4.2.8
-- PHP version -- : 8.0.30
Hi,
I've implemented a Payment plugin based on your example, perfectly working on sandbox, but not working in production for coding problems.
After a lot of checks my Bank support found that the problem is that the Terminal ID sent on initialization and on payment notification is sent not as simple string (a number) but some special charcters are added.
I initiate my plugin parameters through pluginConfig array:
var $pluginConfig = array(
// Sandbox / Production
'enviroment' => array('Ambiente di lavoro', 'list', array(
'production' => 'Production',
'sandbox' => 'Sandbox',
)),
'url_sandbox' => array('URL sandbox', 'input','https://testapif.netsgroup.com/UNI_CG_SERVICES/services'),
'tid_sandbox' => array('ID sandbox', 'input', 'UNI_SEL'),
'kSig_sandbox' => array('API key sandbox', 'input', 'UNI_TESTKEY'),
'payment_url' => array('URL production', 'input', 'https://pagamenti.unicredit.it/UNI_CG_SERVICES/services'),
'tid' => array('ID production', 'input', ''),
'kSig' => array('API key production', 'input', ''),
'debug' => array('DEBUG', 'boolean','0'),
// ... other stuff
);
On database I checked that my values are memorized correctly:
O:8:"stdClass":31:{s:10:"enviroment";s:10:"production";s:11:"url_sandbox";s:55:"https://testapif.netsgroup.com/UNI_CG_SERVICES/services";s:11:"tid_sandbox";s:7:"UNI_SEL";s:12:"kSig_sandbox";s:11:"UNI_TESTKEY";s:11:"payment_url";s:55:"https://pagamenti.unicredit.it/UNI_CG_SERVICES/services";s:3:"tid";s:14:"30888470";s:4:"kSig";s:32:"******************";s:12:"notification";s:1:"0";s:5:"debug";s:1:"1";
The problem is that, when I call them to initiate the transaction process with this call:
$tid = ($this->payment_params->enviroment == 'sandbox') ? $this->payment_params->tid_sandbox : $this->payment_params->tid;
$kSig = ($this->payment_params->enviroment == 'sandbox') ? $this->payment_params->kSig_sandbox : $this->payment_params->kSig;
$payment_url = ($this->payment_params->enviroment == 'sandbox') ? $this->payment_params->url_sandbox : $this->payment_params->payment_url;
$tid is sent as
<U+202A>30888470<U+202C>
instead of
30888470
So that the payment system doesn't recognize the terminal ID and payment fails.
On logs is rendered as 30888470
All other parameters renders as they should be, included the Ksign (the API key).
If I bypass plugin parameter and write it as a string everythig works.
I could make a function to "clean" the erroneus value, but I would like to understand why this parameter is modified and why only this!
Thanks for help.