mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Deprecate API v2 (#7761)
* deprecate api-v2 * remove v2 test helpers * remove unused string
This commit is contained in:
22
website/server/libs/inAppPurchases.js
Normal file
22
website/server/libs/inAppPurchases.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import nconf from 'nconf';
|
||||
import iap from 'in-app-purchase';
|
||||
import Bluebird from 'bluebird';
|
||||
|
||||
// Validation ERROR Codes
|
||||
// const INVALID_PAYLOAD = 6778001;
|
||||
// const CONNECTION_FAILED = 6778002;
|
||||
// const PURCHASE_EXPIRED = 6778003;
|
||||
|
||||
iap.config({
|
||||
// This is the path to the directory containing iap-sanbox/iap-live files
|
||||
googlePublicKeyPath: nconf.get('IAP_GOOGLE_KEYDIR'),
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
setup: Bluebird.promisify(iap.setup, { context: iap }),
|
||||
validate: Bluebird.promisify(iap.validate, { context: iap }),
|
||||
isValidated: iap.isValidated,
|
||||
getPurchaseData: iap.getPurchaseData,
|
||||
GOOGLE: iap.GOOGLE,
|
||||
APPLE: iap.APPLE,
|
||||
};
|
||||
Reference in New Issue
Block a user