Dupe of https://code.google.com/p/google-api-javascript-client/source/checkout