var venmo = Venmo(1424);

function signin() {
  if (venmo.isAuthorized()) {
    $('#signin').addClass('is-hidden');
    picture();
  }

  $('.signin-button').click(function () {
    venmo.authorize();
  });
}

function picture() {
  $('#picture').removeClass('is-hidden');
  $('.signin-submit').click(function () {
    $.ajax({
      url: '/upload',
      data: new FormData($('#image-upload')[0]),
      processData: false,
      contentType: false,
      type: 'POST',
      success: function (receipt) {
        $('#picture').addClass('is-hidden');
        verify(receipt.items);
      }
    });
  });
}

function verify(receipt) {
  $('#verify').removeClass('is-hidden');
}

signin();
@@ -614,47 +614,855 @@
 ion 
-verify(receipt) %7B%0A  $('#verify').remove
+convertPrice(price) %7B%0A  var p = price.toString(10);%0A  if (p.length === 0)%0A    return '$0.00';%0A  if (p.length === 1)%0A    return '$0.0' + p;%0A  if (p.length === 2)%0A    return '$0.' + p;%0A  return '$' + p.slice(0, p.length - 2) + '.' + p.slice(p.length - 2);%0A%7D%0A%0Afunction convertItems(items) %7B%0A  return _.map(items, function (item) %7B%0A    item.price = convertPrice(item.price);%0A    return item;%0A  %7D)%0A%7D%0A%0Afunction verify(items) %7B%0A  $('#verify').removeClass('is-hidden');%0A  var total = _.reduce(items, function (memo, item) %7B%0A    return memo + item.price;%0A  %7D, 0);%0A%0A  var verifyTemplate = _.template($('#template-verify').html());%0A  $('#verify').html(verifyTemplate(%7B%0A    items: convertItems(items),%0A    total: convertPrice(total)%0A  %7D));%0A%0A  friends(items, total);%0A%7D%0A%0Afunction friends(items, total) %7B%0A  $('#verify').addClass('is-hidden');%0A  $('#friends').add
 Clas

Add receipt verify interface