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

Checks improvements #338

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lib/apple.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ var testMode = false;
function isExpired(responseData) {
if (responseData[REC_KEYS.LRI] && responseData[REC_KEYS.LRI][REC_KEYS.EXPIRES_DATE]) {
var exp = parseInt(responseData[REC_KEYS.LRI][REC_KEYS.EXPIRES_DATE]);
if (exp > Date.now()) {
return true;
}
return false;
return exp > Date.now();
}
// old receipt
}
Expand Down Expand Up @@ -349,7 +346,7 @@ module.exports.getPurchaseData = function (purchase, options) {
};

function bool(val) {
return val === 'true' ? true : false;
return val === 'true';
}

function getSubscriptionExpireDate(data) {
Expand Down Expand Up @@ -413,6 +410,8 @@ function send(url, content, cb) {

function applyResponseData(target, source) {
for (var key in source) {
if (!source.hasOwnProperty(key))
continue;
if (target[key] === undefined) {
target[key] = source[key];
}
Expand Down