I want integrating Google Play in-app billing to my unity project that already get payLoad json. I have a Node.js server and want to get value of the Google Play purchase response for server side verification.
My list product on Google Play Developer Console was create productId but i got error:
[Error: The subscription purchase token does not match the subscription ID.]
In my index.js file of my node server I have a segment like this:
var Verifier = require('google-play-purchase-validator');
var options = {
email: '#############[email protected]',
key: '-----BEGIN PRIVATE KEY-----##some private key##-----END PRIVATE KEY-----',
keyFile: './Google Play Android Developer-############.json'
};
var verifier = new Verifier(options);
var receipt = {
packageName:"com.natekgames.######",
productId:"com.natekgames.######.diamond_48",
purchaseToken:"ihfeaepjoppolibmeknoghmo.AO-J1OxbHPDa8QLVAU3OqvIa-ZgaAGWhrBhs8DyCEfFbbdTCH8ecvEXQlZtjkqaowPXujb0Osn_aOWBPMT0OpTMcivoQalEtOZmMhS2lDA7oH868NjZP2LgdE9ODafujNM7O9QQr3-hq"
};
verifier.verify(receipt, function cb(err, response){
if(err){
console.log("there was an error validating the receipt");
console.log(err);
}
console.log("sucessfully validated the receipt");
res.send(response);
});
On your Android phone or tablet, say "Hey Google, open Assistant settings." Or, go to Assistant settings. Payments. Turn Pay through your Assistant on or off. Turn Confirm with fingerprint or face and Confirm with Voice Match on or off.
An in-app purchase is any additional purchase made within an app, like extra lives in a game. You can turn in-app purchases on or off on Apple and Android devices with just a few taps.
productId
parameter is written exactly same way as it's written in Google Play Developer Console.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With