NodeJs helper service to validate in-app purchase using the amazon receipt verification service (RVS).
$ npm install amazon_iap
You can look at Amazon documention about the process here.
After you configure and run the service, you can browse it:
var that = this;
var options = {
email: 'your developer email',
key: 'your developer key'
};
var verifier = new AmzIAPVerifier(options);
var receipt = {
packageName: 'package name',
productId: 'the name of your product',
purchaseToken: 'The response token from the in-app purchase process',
userId: 'The reponse user id from the in-app purchase process'
};
verifier.validateConsumable(receipt, function(err, response) {
if (err) {
console.log('error occur');
} else if(response.itemType == "CONSUMABLE") {
console.log('everything is ok');
} else {
console.log('other error occur');
}
});
1.1.0
MIT
Meir Shamay @meir_shamay
Free Software, Hell Yeah!