Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do open web app receipt checking #10

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

Do open web app receipt checking #10

jrburke opened this issue May 11, 2012 · 1 comment

Comments

@jrburke
Copy link
Member

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
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants