mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 04:29:40 +00:00
fix linter errors
This commit is contained in:
parent
5f3b147d2a
commit
c84d6ba141
1 changed files with 7 additions and 9 deletions
|
|
@ -54,9 +54,9 @@ api.iapAndroidVerify = {
|
||||||
userId: user._id,
|
userId: user._id,
|
||||||
});
|
});
|
||||||
|
|
||||||
var amount = 0;
|
let amount = 0;
|
||||||
|
|
||||||
switch (purchaseData.productId) {
|
switch (receiptObj.productId) {
|
||||||
case 'com.habitrpg.android.habitica.iap.4gems':
|
case 'com.habitrpg.android.habitica.iap.4gems':
|
||||||
amount = 1;
|
amount = 1;
|
||||||
break;
|
break;
|
||||||
|
|
@ -72,11 +72,9 @@ api.iapAndroidVerify = {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (amount === 0) {
|
if (amount === 0) throw new Error('INVALID_ITEM_PURCHASED');
|
||||||
if (!correctReceipt) throw new Error('INVALID_ITEM_PURCHASED');
|
|
||||||
}
|
|
||||||
|
|
||||||
await payments.buyGems({user, paymentMethod: 'IAP GooglePlay', amount: amount, headers: req.headers}); // eslint-disable-line babel/no-await-in-loop
|
await payments.buyGems({user, paymentMethod: 'IAP GooglePlay', amount, headers: req.headers}); // eslint-disable-line babel/no-await-in-loop
|
||||||
|
|
||||||
res.respond(200, googleRes);
|
res.respond(200, googleRes);
|
||||||
},
|
},
|
||||||
|
|
@ -131,14 +129,14 @@ api.iapiOSVerify = {
|
||||||
throw new Error('RECEIPT_ALREADY_USED');
|
throw new Error('RECEIPT_ALREADY_USED');
|
||||||
}
|
}
|
||||||
|
|
||||||
var amount = 0;
|
let amount = 0;
|
||||||
switch (purchaseData.productId) {
|
switch (purchaseData.productId) {
|
||||||
case 'com.habitrpg.ios.Habitica.4gems':
|
case 'com.habitrpg.ios.Habitica.4gems':
|
||||||
amount = 1;
|
amount = 1;
|
||||||
break;
|
break;
|
||||||
case 'com.habitrpg.ios.Habitica.20gems':
|
case 'com.habitrpg.ios.Habitica.20gems':
|
||||||
case 'com.habitrpg.ios.Habitica.21gems':
|
case 'com.habitrpg.ios.Habitica.21gems':
|
||||||
amount = 5.25
|
amount = 5.25;
|
||||||
break;
|
break;
|
||||||
case 'com.habitrpg.ios.Habitica.42gems':
|
case 'com.habitrpg.ios.Habitica.42gems':
|
||||||
amount = 10.5;
|
amount = 10.5;
|
||||||
|
|
@ -151,7 +149,7 @@ api.iapiOSVerify = {
|
||||||
correctReceipt = false;
|
correctReceipt = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
await payments.buyGems({user, paymentMethod: 'IAP AppleStore', amount: amount, headers: req.headers}); // eslint-disable-line babel/no-await-in-loop
|
await payments.buyGems({user, paymentMethod: 'IAP AppleStore', amount, headers: req.headers}); // eslint-disable-line babel/no-await-in-loop
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!correctReceipt) throw new Error('INVALID_ITEM_PURCHASED');
|
if (!correctReceipt) throw new Error('INVALID_ITEM_PURCHASED');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue