Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter keueram72

    (@keueram72)

    It looks like that support thread does explain what I am looking to do, but it does not work for the latest version of the plugin(V4.1.0) since it added “robust price validation checks.”

    As you can see from my code in the earlier post, a “hash_one” value is now required. This is generated from within wordpress-simple-paypal-shopping-cart/wp_shopping_cart.php:

    $_POST['wspsc_product'] = strip_tags($_POST['wspsc_product']); //for PHP5.2 use filter_var($_POST['wspsc_product'], FILTER_SANITIZE_STRING);
            $_POST['item_number'] = strip_tags($_POST['item_number']);
            if (isset($_POST['price'])){
                $_POST['price'] = strip_tags($_POST['price']);
                //Validate price
                $hash_once_p = strip_tags($_POST['hash_one']);
                $p_key = get_option('wspsc_private_key_one');
                $hash_one_cm = md5($p_key.'|'.$_POST['price']);
                if($hash_once_p != $hash_one_cm){//Validation failed
                    wp_die('Error! The price validation failed.');
                }
            }

    If you comment this section out, hash_one value is not required, but clearly the price check does not work. Any thoughts on how I could generate this hash value, since I am inserting fields like “wspc_product” “price” “cartlink” and “product_tmp” through the use of generated variables within the template depending on what book is being displayed?

    Thread Starter keueram72

    (@keueram72)

    Thank you! Compatibility view actually seemed to work. I also just noticed there is an update for my WordPress so hopefully the update will address this issue too. Thanks so much again.

Viewing 2 replies - 1 through 2 (of 2 total)