Skip to content

Instantly share code, notes, and snippets.

@stupakov
Created May 20, 2014 02:34
Show Gist options
  • Save stupakov/c51515945b8738f10862 to your computer and use it in GitHub Desktop.
Save stupakov/c51515945b8738f10862 to your computer and use it in GitHub Desktop.
referralcandy debugging - attempt 2

MD5 was generated by:

# ruby
string = [email, first_name, invoice_amount, timestamp, account_secret].join(',')
Digest::MD5.hexdigest(string)

(Values are not URI-escaped before computing the MD5 sum.)

Div generated by my app code

<div
  id="refcandy-popsicle"
  data-app-id="gcvqkjv82r89536yw1f7se27e"
  data-fname="Alex"
  data-lname="Order12"
  data-email="[email protected]"
  data-amount="0.00"
  data-currency="USD"
  data-timestamp="1400553065"
  data-signature="aa814e6da0c9797a5505ed283c2f16da"
></div>

Request generated by referralcandy js code:

GET 'http://go.referralcandy.com/purchase/gcvqkjv82r89536yw1f7se27e.js?lightbox=1&aa=75&a=stupakov%2Bbf12%40gmail.com&b=Alex&c=Order12&d=0.00&e=USD&&g=1400553065&&&ab=aa814e6da0c9797a5505ed283c2f16da'

Response

400 Bad Request

Entire source of the custom order confirmation page is below

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Butterfleye</title>
    <link href="http://d2m6m59lf3nydc.cloudfront.net/assets/favicon-e5c77024667dea41fc79cefa6463538e.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
    <link data-turbolinks-track="true" href="http://d2m6m59lf3nydc.cloudfront.net/assets/application-35db4ef73cd07e99dfdf2da89cc525dd.css" media="all" rel="stylesheet" />
    <script src="http://d2m6m59lf3nydc.cloudfront.net/assets/vendor/modernizr-5603564e38fa90c6f2d76c767d9de836.js"></script>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,400,300,700' rel='stylesheet' type='text/css'>
    <script type="text/javascript" src="https://www.trycelery.com/js/celery.js"></script>
    <meta content="authenticity_token" name="csrf-param" />
<meta content="pPt6V/0aRyh31+iNn3iytpjRENmCMSkW9Yb20IsOAK0=" name="csrf-token" />
  </head>

  <body>

    
    
<div class="section order-confirmation">
  <div class="row text-center row-section-title">
    <h2>Thanks for your order!</h2>
  </div>
  <div class="row">
    <div class="columns small-centered small-10">
      You'll receive an email confirmation shortly for your records.
    </div>
  </div>
</div>

<div
  id="refcandy-popsicle"
  data-app-id="gcvqkjv82r89536yw1f7se27e"
  data-fname="Alex"
  data-lname="Order12"
  data-email="[email protected]"
  data-amount="0.00"
  data-currency="USD"
  data-timestamp="1400553065"
  data-signature="aa814e6da0c9797a5505ed283c2f16da"
></div>


    <div class="section section-footer">
  <div class="row row-footer">
    <div class="small-12 small-centered columns">
      <div class="row">
        <div class="small-12 medium-4 large-3 columns">
          © Butterfleye Inc.
        </div>

        <div class="small-12 medium-8 large-9 columns">
          <div class="footer-links">
            <div class="footer-link">
              <a href="/faq">FAQ</a>
            </div>
            <div class="footer-link">
              <a href="/about">About</a>
            </div>
            <div class="footer-link">
              <a href="/terms">Terms of Service</a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

    <script data-turbolinks-track="true" src="http://d2m6m59lf3nydc.cloudfront.net/assets/application-bc06beca6b5625b851d75056d8893293.js"></script>
      <script>(function(e){var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v;f="script";l="refcandy-purchase-js";c="refcandy-popsicle";p="go.referralcandy.com/purchase/";t="data-app-id";r={email:"a",fname:"b",lname:"c",amount:"d",currency:"e","accepts-marketing":"f",timestamp:"g","referral-code":"h",locale:"i",signature:"ab"};i=e.getElementsByTagName(f)[0];s=function(e,t){if(t){return""+e+"="+encodeURIComponent(t)}else{return""}};d=function(e){return""+p+h.getAttribute(t)+".js?lightbox=1&aa=75&"};if(!e.getElementById(l)){h=e.getElementById(c);if(h){o=e.createElement(f);o.id=l;a=function(){var e;e=[];for(n in r){u=r[n];v=h.getAttribute("data-"+n);e.push(s(u,v))}return e}();o.src=""+e.location.protocol+"//"+d(h.getAttribute(t))+a.join("&");return i.parentNode.insertBefore(o,i)}}})(document);</script>


  </body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment