From 43961a5ab948def947406673380c2ddb4df6b596 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Tue, 16 Dec 2014 11:43:58 -0700 Subject: [PATCH] refactor(iap): use env var for google IAP, intead of key file. See https://github.com/voltrue2/in-app-purchase/commit/cb31043281dc1221c61efb2dfbd13687761bceca cc @negue --- config.json.example | 2 +- package.json | 2 +- src/controllers/payments/iap.js | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/config.json.example b/config.json.example index 74e2f0822c..196ceb369f 100644 --- a/config.json.example +++ b/config.json.example @@ -42,7 +42,7 @@ "client_id":"client_id", "client_secret":"client_secret" }, - "IAP_GOOGLE_KEYDIR": "/path/to/google/public/key/dir/", + "GOOGLE_IAB_PUBLICKEY_LIVE": "GOOGLE_IAB_PUBLICKEY_LIVE", "LOGGLY": { "enabled": false, "subdomain": "subdomain", diff --git a/package.json b/package.json index 6f14a60e51..84fd5bccfc 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "grunt-nodemon": "~0.3.0", "habitrpg-shared": "git://github.com/HabitRPG/habitrpg-shared#develop", "icalendar": "git://github.com/lefnire/node-icalendar#master", - "in-app-purchase": "^0.2.0", + "in-app-purchase": "^0.3.0", "jade": "~1.7.0", "js2xmlparser": "~0.1.2", "lodash": "~2.4.1", diff --git a/src/controllers/payments/iap.js b/src/controllers/payments/iap.js index 29b03fedfb..9dcef12efc 100644 --- a/src/controllers/payments/iap.js +++ b/src/controllers/payments/iap.js @@ -3,12 +3,6 @@ var async = require('async'); var payments = require('./index'); var nconf = require('nconf'); -var inAppPurchase = require('in-app-purchase'); -inAppPurchase.config({ - // this is the path to the directory containing iap-sanbox/iap-live files - googlePublicKeyPath: nconf.get("IAP_GOOGLE_KEYDIR") -}); - // Validation ERROR Codes var INVALID_PAYLOAD = 6778001; var CONNECTION_FAILED = 6778002;