The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Setting up Referral Candy on the receipt page

mreeemreee Member
in Help edited August 2013
I am following these directions to set up referral candy on the receipt page
http://help.referralcandy.com/customer/portal/articles/1120694-how-can-i-show-a-post-purchase-popup-to-my-customers-

I have it figured out except for the last step:

Calculate the value for the 'data-signature' attribute as follows:
MD5(EMAIL,FIRST_NAME,INVOICE_AMOUNT,TIMESTAMP,ACCOUNT_SECRET)

I am not sure what values to enter here. Possibly the twig template?

Thanks!
Comments
  • fc_adamfc_adam FoxyCart Team
    @mreee,

    Am I correct in assuming that you'd want that to be calculated server-side as you wouldn't want your account_secret value being displayed in the javascript? If so, that might make it a little more involved to set up as you'd need to get that value from a PHP script on your own server, but you'd need to have a secure certificate for your domain as you can't communicate with an insecure endpoint from a secure page such as our checkout.

    If it's not an issue though, you could set this up with javascript, there are a few MD5 implementations for javascript you could utilize.
  • @fc_adam,

    It needs to be server side but I have an ssl certificate for my site.
  • @fc_adam,

    I've been trying to figure out the best way to set this up but haven't really got anywhere. Can you point me in the right direction?

    THanks
  • winstonwinston FoxyCart Team
    @mreee

    Adam is out for a day or two, but I'll make sure he looks at this as soon as he's back in. Sorry for the delay.
  • fc_adamfc_adam FoxyCart Team
    @mreee,

    So basically it'd be a few steps.

    Firstly, you'd need to have a script on your server that takes a few pieces of information - specifically the email, first name, invoice total and timestamp - and create that MD5 string by adding in your account secret, then echoing it on the page.

    Then within your receipt template, you'd call that endpoint using an AJAX request, and in the callback function for when it completes, you'd dynamically add in the required information into your receipt template as noted on the referral candy page.

    Does that help?
Sign In or Register to comment.