HMAC — confused about how to implement

Hello!

I would like to implement HMAC. Our store is in development (FoxyCart v2). I have built a test page: http://www.keepbooks.org/testonly.html and it all seems to work fine without HMAC.

I don't understand the HMAC documentation. I'm a novice when it comes to PHP etc.

I am trying Manual Signing via FoxyCart Administration because it seems simplest for my level of understanding.

I put my form code info into the box on the Sample Code page (https://admin.foxycart.com/admin.php?ThisAction=SampleCode) and it generates output.

1) It's not clear to me what I would put in the <! link example--> section.
2) And it's not clear to me where I put the output once it's generated.

Thank you!
Tagged:
Comments
  • brettbrett FoxyCart Team
    Hi @KEEPBOOKS. We're happy to help. There are a few options. If you're doing PHP, you can pretty easily just edit your template file (or header/footer includes), assuming you're kind of doing "raw" PHP without a framework. If you've got a framework or CMS, that'd change things a little. Let us know what system you're using to build the site if you'd like to explore ways to automate this.

    If you want to just do things manually, you'd just copy/paste your forms or links into the "Step 2" section, then hit the "encode HTML" button. You'll get signed HTML back (assuming your links or forms are pointing to your own store domain, and all the products have `code` values in 'em).

    The "link example" comment is just as an example. You'd replace that whole textarea with your own HTML to sign your stuff. Does that help?
  • KEEPBOOKSKEEPBOOKS Member
    edited April 29
    Hi @brett

    Thanks for the quick reply.

    This is a simple html / css site on IIS, and I have no PHP experience.

    From your last paragraph it sounds like I just replace the code between <form.. > and </form> with the encoded output? We have about 40 products so it wouldn't be too time consuming to do that.
  • fc_adamfc_adam FoxyCart Team
    @KEEPBOOKS,

    That's right - once you've signed the form through the administration, you would copy the <form> tag from the output and paste it into your website where you want the add to cart form to appear. You can then try out the form and ensure it's working as you expect.

    Let us know if we can help any further!
  • KEEPBOOKSKEEPBOOKS Member
    Thank you, @fc_adam ! I'll give that a try.
Sign In or Register to comment.