• Resolved syednazrulhassan

    (@nazrulhassanmca)


    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 on

    cf7-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&currency=INR&amount='.$amount.'&redirect_url='.$redirect_url.'&cancel_url='.$cancel_url.'&order_id='.time();
    

    Regards
    Nazrul

Viewing 1 replies (of 1 total)
  • Thread Starter syednazrulhassan

    (@nazrulhassanmca)

    Update 1
    I have also added following line of code on

    cf7-cc-avenue-add-on/includes/cf7_ccav_process_payment.php as line 167

    else that results in Screen Grab

    $amount = (float) $_SESSION['amount_total'];

    The following lines from line 192 to 196 on

    cf7-cc-avenue-add-on/includes/cf7_ccav_process_payment.php

    $result .= '<input type="hidden" id="cf7ccav_ccavenue_nonce" value="$nonce">';
    $result .= '<input type=hidden name="encRequest" value="'. $encrypted_data. '">';
    $result .= '<input type="hidden" name="Amount" value="'.$_SESSION['amount_total'].'">';
    $result .= '<input type="hidden" name="access_code" value="'. $access_code .'">';
    $result .= '<input type="hidden" name="currency" value="'.$currency.'"/>';

    Have been replaced by

    $result .= '<input type="hidden" id="cf7ccav_ccavenue_nonce" value="'.$nonce.'">';
    $result .= '<input type="hidden" name="encRequest" value="'. $encrypted_data. '">';
    $result .= '<input type="hidden" name="access_code" value="'.$access_code.'">';
Viewing 1 replies (of 1 total)
  • The topic ‘PHP 7.1 + CF7 5.1.4 Working Code’ is closed to new replies.