About Insteegram

insteegram is the easiest way to print your instagram photos onto a comfy American Apparel tshirt.

GET FEATURED:
*Tag your Insteegram Shirt (#insteegram) and we'll reblog it here ! Thanks for your support! Oy oy!

Cutting Out the BS

At Insteegram, we want to cut out the BS.  We don’t want you to create a profile.  We don’t want you to upload your images.  We don’t want to collect your data.  We provide a service and we want you to get from point A to point Z as quick as possible.

When one arrives at insteegram.com, the home page should be self-explanatory (we hope).  Once logged in, we wanted to minimize the clicks.  Login, customize, confirm, checkout.  Minimal enough?  Not for us.  Why confirm?  Why not cut that BS out?

The challenge here was that we need to post information to our own server first, then (if valid) to Paypal’s server. 

So I decided to do make the information post to Paypal and have an onSubmit javascript event handler activate an ajax post call to our own server.  The problem is that there are bits of data that must be returned from our server that must be included in the post to paypal.  That doesn’t work.  Even if we used the DOM to populate a couple more hidden input tags right before the post to paypal, it’s too late.  Once you click that SUBMIT button, you can’t alter the data.

I realized I was trying to find an overly complicated solution to a simple problem.  In order to cut out the BS, I was adding more BS to the code.  THAT is just unacceptable.  So I went with a ridiculously simple solution that is 2^256 times better.  The “duh” solution?  Post to our own server.  If data is good, populate another form for paypal.  Except on this form, all the inputs are hidden and there’s a small snippet of javascript on top which tells the browser to post on its own:

window.onload = function(){
            document.paypalform.submit();

And, that’s all there is to it.  That’s how we cut the BS.

Posted on Thursday, December 29th 2011