Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Help with HMAC validation and multiple price points

jrwhipjrwhip Member
in Help edited November 2014
I can get everything working fine with the php function you have for HMAC validation, but I am running into a problem with multiple price points. I need one price for a one time order and a discounted price for a subscription.

My store is located at: http://benjamin.ximo365.com/product-line.php

The product options work fine without validation, but I am at a loss for how to do this with it. Any suggestions?
Tagged:
Comments
  • fc_adamfc_adam FoxyCart Team
    @jrwhip,

    One way you could approach it would be to have the actual hmac-ed values set on your javascript that changes out the prices - so when it switches, it switches in the complete HMAC encrypted value as well.

    Another approach would be to HMAC the price field as being open, but that kind of negates the benefit of the price validations with HMAC.
  • How do I set an open value when I use the php whole page validation?
  • fc_adamfc_adam FoxyCart Team
    @jrwhip,

    Look at the user-editable inputs section of the HMAC wiki page: http://wiki.foxycart.com/static/redirect/price_validation
  • I've seen that, it explains how to do it using the php function for forms one at a time. How do you do it for the whole page?

    If I was to make a form like this:
    <input type="hidden" name="whatever" value="—OPEN—">
    

    It doesn't work. Plus it's a really crappy default value
  • fc_adamfc_adam FoxyCart Team
    @jrwhip,

    Sorry for the confusion there. You'll need to leave the value empty, like:
    <input type="hidden" name="whatever" value="">
    
  • That worked. Thank you.
  • I can't use the whole page validation because I need to have some open items with default values. So I am going to validate with the individual function.

    I am running into a problem with hidden values. If I put this it works
    <input type="hidden" name="<?php echo get_verification('referral_source', '--OPEN--', $sku); ?>" value="{{ coach.firstName }} {{ coach.lastName }}">
    
    But what I need is to put this
    <input type="hidden" name="<?php echo get_verification('h:referral_source', '--OPEN--', $sku); ?>" value="{{ coach.firstName }} {{ coach.lastName }}">
    
    And that doesn't work.
  • Solution:

    I tried hashing the h: for the hidden indicator in the hash and that broke everything.
    Then I tried putting the h: outside the hash, like you do for multiple products as in 2: 3: etc. and that also broke everything.

    The solution was to not hash it, and that worked. So if you have HMAC validation on foxycart requires you to hash all regular inputs and to not hash hidden inputs.
  • fc_adamfc_adam FoxyCart Team
    @jrwhip,

    Ah yes, sorry for the confusion there. Inputs preceded by "h:", "x:", or "__" aren't hashed.
Sign In or Register to comment.