Commit 2598780c authored by Varun Sridharan's avatar Varun Sridharan

Issue Fixed

* Fixed #56
* Fixed #62
parent 61e0140e
...@@ -134,7 +134,7 @@ class WooCommerce_Quick_Donation_Admin_Function { ...@@ -134,7 +134,7 @@ class WooCommerce_Quick_Donation_Admin_Function {
$type = 'simple'; $type = 'simple';
$install = new WC_QD_INSTALL; $install = new WC_QD_INSTALL;
$callBack_function = 'create_'.$type.'_donation'; $callBack_function = 'create_'.$type.'_donation';
$donation_exist = $install::check_donation_exists(); $donation_exist = $install->check_donation_exists();
if(isset($_REQUEST['force'])){ if(isset($_REQUEST['force'])){
$post_id = $install->$callBack_function(); $post_id = $install->$callBack_function();
......
...@@ -398,25 +398,11 @@ class WooCommerce_Quick_Donation_Functions { ...@@ -398,25 +398,11 @@ class WooCommerce_Quick_Donation_Functions {
public function encryptor($action, $string) { public function encryptor($action, $string) {
$output = false; $output = false;
$encrypt_method = "AES-256-CBC";
//pls set your unique hashing key
$secret_key = 'muni';
$secret_iv = 'muni123';
// hash
$key = hash('sha256', $secret_key);
// iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning
$iv = substr(hash('sha256', $secret_iv), 0, 16);
//do the encyption given text/string/number
if( $action == 'encrypt' ) { if( $action == 'encrypt' ) {
$output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv); $output = base64_encode($string);
$output = base64_encode($output);
} }
else if( $action == 'decrypt' ){ else if( $action == 'decrypt' ){
//decrypt the given text/string/number $output = base64_decode($string);
$output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);
} }
return $output; return $output;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment