PHP 7.1 + CF7 5.1.4 Working Code
-
Dear Plugin Author Mahesh,
You did a fantastic job in creating the plugin recently i had to work on php7.1 and contact form7 5.1.4 and lots of things needs to be be updated so i fixed it up and and posting a dropbox Link here
https://www.dropbox.com/s/div55hkfohpnhyo/cf7-cc-avenue-add-on.zip?dl=0
If you can please update the plugin lots of people from wordpress community will be benifited.
Summary
The error500 on php7 is due to encrypt and decrypt functions have been deprecated in php7 which has been updated oncf7-cc-avenue-add-on/includes/ccavenue/crypto.php as below
function encrypt($plainText,$key) { $secretKey = hextobin(md5($key)); $initVector = pack("C*", 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f); $encryptedText = openssl_encrypt($plainText, "AES-128-CBC", $secretKey, OPENSSL_RAW_DATA, $initVector); $encryptedText = bin2hex($encryptedText); return $encryptedText; } function decrypt($encryptedText,$key) { $secretKey = hextobin(md5($key)); $initVector = pack("C*", 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f); $encryptedText = hextobin($encryptedText); $decryptedText = openssl_decrypt($encryptedText,"AES-128-CBC", $secretKey, OPENSSL_RAW_DATA, $initVector); return $decryptedText; }
The required paramaters are not being posted to CC avenue to process it that i have added on
cf7-cc-avenue-add-on/includes/cf7_ccav_process_payment.php as line 169
$merchant_data = 'merchant_id='.$merchant_id.'&language=EN¤cy=INR&amount='.$amount.'&redirect_url='.$redirect_url.'&cancel_url='.$cancel_url.'&order_id='.time();
Regards
Nazrul
- The topic ‘PHP 7.1 + CF7 5.1.4 Working Code’ is closed to new replies.