mozilla/receiptverifier — pull request #22 by jaredkerim (2014-09-17 20:05:26+00:00)
Title: Unknown option: storeURL (bug 1045716)

Original problem description is:

With the latest code and with an HTML page that runs this:

mozmarket.receipts.Prompter({
storeURL: "https://marketplace.mozilla.org/app/myapp",
supportHTML: 'email me@example.com',
verify: true
});

I get this error: Unknown option: storeURL.

After experimenting I find that:

mozmarket.receipts.Prompter({
storeURL: "https://marketplace.mozilla.org/app/myapp",
supportHTML: 'email me@example.com',
verify: false
});

"Unknown option: storeURL"

new mozmarket.receipts.Prompter({
storeURL: "https://marketplace.mozilla.org/app/myapp",
supportHTML: 'email me@example.com',
verify: false
});

Prompter {overlay: null, storeURL: "https://marketplace.mozilla.org/app/myapp", supportHTML: "email me@example.com", allowNoInstall: false, ignoreInternalError: false…}

There is a line designed to catch this here: https://github.com/mozilla/receiptverifier/blob/master/receiptverifier-ui.js#L88-L90

However I think that the test was malformed, example:

this instanceof Prompter
false

! this instanceof Prompter
false

! (this instanceof Prompter)
true

I think this should solve the problem.