我正在开发一款具有某种应用内购买功能的移动应用。
现在在后端/服务器端我想验证来自谷歌的购买信息。节点中有很少的模块用于验证,但它们只是验证数据是否正确,但不是联系谷歌相同。 任何人都可以给予任何相同的建议.. 应用内购买数据就像是。
{
"orderId":"12999763169054705758.1364365967744519",
"packageName":"my package name",
"productId":"77",
"purchaseTime":1366217534000,
"purchaseState":0,
"purchaseToken":"utfwimslnrrwvglktizikdcd.AOJ1OwZ4l5oXz_3d2SAWAAUgFE3QErKoyIX8WuSEnBW26ntsyDmlLgoUd5lshqIY2p2LnlV4tpH4NITB4mJMX98sCtZizH7wGf6Izw3tfW_GflJDKFyb-g"
}
答案 0 :(得分:1)
您是否尝试了同级的iab_verifier模块
在此Google Play中,公钥需要对应用结算进行身份验证
var IABVerifier = require('iab_verifier'),
var googleplay_public_key = "-- YOUR PUBLIC KEY --";
var googleplayVerifier = new IABVerifier(googleplay_public_key);
var receiptData = receiptDataFromClient;
var receiptSignature = signatureDataFromClient;
var isValid = googleplayVerifier.verifyReceipt(receiptData,receiptSignature);
if (result) {
// Receipt is valid. Grab a beer celebrate!
} else {
// Receipt is NOT valid...
}
感谢