diff --git a/lib/apple/index.js b/lib/apple/index.js index 657cbd5..215459a 100644 --- a/lib/apple/index.js +++ b/lib/apple/index.js @@ -112,8 +112,12 @@ exports.verifyPayment = function (payment, cb) { return cb(error); } - if (payment.hasOwnProperty('packageName') && payment.packageName !== result.receipt.bundle_id) { - return cb(new Error('Wrong bundle ID: ' + result.receipt.bundle_id + ' (expected: ' + payment.packageName + ')')); + if (payment.hasOwnProperty('packageName') && result.result == 'verified' && payment.packageName !== result.receipt.bundle_id) { + return cb(null, { + result: 'failed', + receipt: result.receipt, + message: 'Wrong bundle ID: ' + result.receipt.bundle_id + ' (expected: ' + payment.packageName + ')' + }); } return cb(null, result); diff --git a/lib/google/index.js b/lib/google/index.js index 8fbefe5..7ddbcb8 100644 --- a/lib/google/index.js +++ b/lib/google/index.js @@ -64,7 +64,6 @@ exports.verifyPayment = function (payment, cb) { } if (res.statusCode !== 200) { - if (res.statusCode == 400) { var responseObject; try { @@ -76,7 +75,6 @@ exports.verifyPayment = function (payment, cb) { result: 'failed', message: responseObject.error.message }); - } else { return cb(new NetworkError('Received ' + res.statusCode + ' status code with body: ' + responseString)); }