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