Open spedalilama opened 5 years ago
I don't know if the answer to your question is yes, but for google service account, I pass the receipt as an object (not a string) (thus the code you see will work).
receipt = {
packageName: developerNotification.packageName,
productId: developerNotification.subscriptionNotification.subscriptionId,
purchaseToken: developerNotification.subscriptionNotification.purchaseToken,
subscription: true
};
await processPurchaseReceipt({
receipt: receipt,
userId: null
});
Can you please let me know where I can get the following information from?
googleServiceAccount: { clientEmail: 'xxxxxxxxxxxxxxxxxx, privateKey: 'xxxxxxxxxxxxxxxxxx' },
I am trouble validating for Google with a Google Service Account was wondering if in index.js (line 107) the check for receipt.purchaseToken should be parsed.purchasedToken (code snipet from index.js below)
try { // receipt could be either Google, Amazon, or Unity (Apple or Google or Amazon) var parsed = JSON.parse(receipt); if (isUnityReceipt(parsed)) { return module.exports.UNITY; } if (parsed.signature) { return module.exports.GOOGLE; } else if (receipt.purchaseToken) { return module.exports.GOOGLE; } else { return module.exports.AMAZON; } }