2025-06-19 05:40:38 +00:00
|
|
|
/*
|
2016-06-26 15:04:16 +00:00
|
|
|
import nconf from 'nconf';
|
2018-03-15 18:59:36 +00:00
|
|
|
import util from 'util';
|
2016-06-26 15:04:16 +00:00
|
|
|
import iap from 'in-app-purchase';
|
|
|
|
|
|
|
|
|
|
// Validation ERROR Codes
|
2016-06-27 12:26:20 +00:00
|
|
|
// const INVALID_PAYLOAD = 6778001;
|
2016-06-26 15:04:16 +00:00
|
|
|
// const CONNECTION_FAILED = 6778002;
|
|
|
|
|
// const PURCHASE_EXPIRED = 6778003;
|
|
|
|
|
|
|
|
|
|
iap.config({
|
2016-06-27 12:26:20 +00:00
|
|
|
// This is the path to the directory containing iap-sanbox/iap-live files
|
2016-06-26 15:04:16 +00:00
|
|
|
googlePublicKeyPath: nconf.get('IAP_GOOGLE_KEYDIR'),
|
2018-12-06 16:13:49 +00:00
|
|
|
googleAccToken: nconf.get('PLAY_API_ACCESS_TOKEN'),
|
|
|
|
|
googleRefToken: nconf.get('PLAY_API_REFRESH_TOKEN'),
|
|
|
|
|
googleClientID: nconf.get('PLAY_API_CLIENT_ID'),
|
|
|
|
|
googleClientSecret: nconf.get('PLAY_API_CLIENT_SECRET'),
|
2017-02-21 18:22:13 +00:00
|
|
|
applePassword: nconf.get('ITUNES_SHARED_SECRET'),
|
2016-06-26 15:04:16 +00:00
|
|
|
});
|
|
|
|
|
|
2019-10-02 17:45:27 +00:00
|
|
|
export default {
|
2018-03-15 18:59:36 +00:00
|
|
|
setup: util.promisify(iap.setup.bind(iap)),
|
|
|
|
|
validate: util.promisify(iap.validate.bind(iap)),
|
2016-07-04 14:12:43 +00:00
|
|
|
isValidated: iap.isValidated,
|
2022-11-11 12:54:17 +00:00
|
|
|
isCanceled: iap.isCanceled,
|
|
|
|
|
isExpired: iap.isExpired,
|
2016-07-04 14:12:43 +00:00
|
|
|
getPurchaseData: iap.getPurchaseData,
|
2016-07-04 13:45:52 +00:00
|
|
|
GOOGLE: iap.GOOGLE,
|
2016-07-04 14:12:43 +00:00
|
|
|
APPLE: iap.APPLE,
|
2016-09-07 17:58:26 +00:00
|
|
|
};
|
2025-06-19 05:40:38 +00:00
|
|
|
*/
|