Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Forgot a new when initializing verifier. Added logging when verifyRec…

…eipts is misused
  • Loading branch information...
commit 648a42171434067207a12ea22cffa0b7419e682a 1 parent 9deebc8
@ianb ianb authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 receiptverifier.js
View
7 receiptverifier.js
@@ -20,7 +20,7 @@ var Verifier = function (options) {
this.receiptVerifications = {};
this._cacheStorage = options.cacheStorage || localStorage;
this.cacheTimeout = options.cacheTimeout || this.defaultCacheTimeout;
- this.state = this.states.VerificationIncomplete('.verify() has not been called');
+ this.state = new this.states.VerificationIncomplete('.verify() has not been called');
this.requestTimeout = options.requestTimeout || this.defaultRequestTimeout;
this.refundWindow = options.refundWindow || this.defaultRefundWindow;
this.installs_allowed_from = options.installs_allowed_from || undefined;
@@ -195,6 +195,11 @@ Verifier.prototype = {
verifyReceipts: function (app, onVerified) {
if ((! app.receipts) || (! app.receipts.length)) {
+ if (app.receipts === undefined) {
+ this.log(self.levels.ERROR,
+ "The .receipts property of the app object is undefined (app: "
+ + JSON.stringify(app) + ")");
+ }
this.state = new this.states.NoReceipts("No receipts were found or installed");
return;
}

0 comments on commit 648a421

Please sign in to comment.
Something went wrong with that request. Please try again.