Do open web app receipt checking #10

Open
jrburke opened this Issue May 11, 2012 · 1 comment

Comments

Projects
None yet
2 participants
Owner

jrburke commented May 11, 2012

Do open web app receipt checking. The getSelf() call for the mozApps, in the onsuccess, there will be a request.result._receipts array with receipts that can be checked for validity.

This document describes the format of each request:
https://wiki.mozilla.org/Apps/WebApplicationReceipt

There should be a call to the "verify" url in each receipt to make sure it is still valid, and if the user is offline, the result of the check should be cached for offline use.

Some things to consider:

  • How to store the offline cached verification. _receipts is an array, but it can change over time, so try to find some other id to use for caching.
  • What UI action to take if a receipt is not valid? Maybe for now just show a twitter bootstrap alert? But it seems like an invalid receipt means the app should not run at all. Redirect to a "receipt not valid, here is what to do next" page? Ask the apps folks for guidance.

To see code with a receipt:

Go to:
https://marketplace-dev.allizom.org/en-US/app/myscotch/

install it, then go to this page to see a receipt dump:
http://andymckay.github.com/myscotch/

ianb commented May 18, 2012

I'm doing some work on this here: https://github.com/ianb/openwebapps-helpers
It'll probably be moved over to this file later: https://github.com/mozilla/zamboni/blob/master/mkt/site/templates/site/mozmarket.js

It'll be UI-neutral.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment