Skip to main content

Update PHP error

More
8 years 5 days ago - 8 years 5 days ago #298542 by dvddvd
Update PHP error was created by dvddvd
-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.12
-- PHP version -- : 7.1.22

Hello,

when I do the php update to version 7.2 and make a payment through the servired gateway. Give the following error:



"0 call to undefined function mcrypt_encrypt()

Thanks
Last edit: 8 years 5 days ago by dvddvd.

Please Log in or Create an account to join the conversation.

More
8 years 4 days ago #298560 by nicolas
Replied by nicolas on topic Update PHP error
Hi,

Indeed, this function has been deprecated in PHP 7.2
The solution is to use openssl_encode instead which should normally be available.
Change the line:
Code:
$encryptkey = mcrypt_encrypt(MCRYPT_3DES, $decodekey, (string)$orderServired, MCRYPT_MODE_CBC, $iv);
to:
Code:
$message_padded = $orderServired; if (strlen($message_padded) % 8) { $message_padded = str_pad($message_padded, strlen($message_padded) + 8 - strlen($message_padded) % 8, "\0"); } $encryptkey = openssl_encrypt($message_padded, "DES-EDE3-CBC", $decodekey, OPENSSL_RAW_DATA | OPENSSL_NO_PADDING, $iv);
in the file plugins/hikashoppayment/servired/servired.php and that should fix the problem.
Please let us know how it works so that we can include the change on our end as we don't have the necessary information to test the servired payment plugin on our end.
Please also note that it requires PHP to support openSSL (it should be the case already for the vast majority of hostings):
php.net/manual/en/openssl.installation.php
The following user(s) said Thank You: dvddvd

Please Log in or Create an account to join the conversation.

More
7 years 11 months ago #298861 by dvddvd
Replied by dvddvd on topic Update PHP error
Thank you Nicilas,
works correctly!!!
The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.227 seconds
Powered by Kunena Forum