mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
more logging
This commit is contained in:
@@ -24,6 +24,7 @@ api.iapAndroidVerify = {
|
||||
middlewares: [authWithUrl],
|
||||
async handler (req, res) {
|
||||
let resObject = await iapAndroidVerify(res.locals.user, req.body);
|
||||
console.log(resObject);
|
||||
return res
|
||||
.status(resObject.ok === true ? 200 : 500)
|
||||
.json(resObject);
|
||||
@@ -43,6 +44,7 @@ api.iapiOSVerify = {
|
||||
middlewares: [authWithHeaders()],
|
||||
async handler (req, res) {
|
||||
let resObject = await iapIOSVerify(res.locals.user, req.body);
|
||||
console.log(resObject)
|
||||
return res
|
||||
.status(resObject.ok === true ? 200 : 500)
|
||||
.json(resObject);
|
||||
|
||||
@@ -26,6 +26,7 @@ async function iapAndroidVerify (user, iapBody) {
|
||||
try {
|
||||
await iapSetup();
|
||||
|
||||
console.log('iapbody', JSON.stringify(iapBody));
|
||||
let testObj = {
|
||||
data: iapBody.transaction.receipt,
|
||||
signature: iapBody.transaction.signature,
|
||||
@@ -34,6 +35,7 @@ async function iapAndroidVerify (user, iapBody) {
|
||||
googleRes = await iapValidate(iap.GOOGLE, testObj);
|
||||
|
||||
if (iap.isValidated(googleRes)) {
|
||||
console.log('test obj', JSON.stringify(testObj));
|
||||
token = testObj.data.token || testObj.data.purchaseToken;
|
||||
|
||||
let existingReceipt = await IapPurchaseReceipt.findOne({
|
||||
|
||||
Reference in New Issue
Block a user