Open ramirobg94 opened 4 years ago
I have the same issue. For me, it was because that my Google Play receipt were being interpreted as Amazon receipts due to a missing signature field.
Hi! Im having the same issue. How was this resiolved?
Thanks
Sorry, but can someone tell me where I can find the following:
const googleConfig = { googleServiceAccount: { clientEmail: , privateKey: },
did somebody solve it? I tried everything but I still get this issue.
I had the same issue when trying to validate a subscription. The information I had saved from Google didn't indicate it being a subscription. Examples for how I got it working.
Not working:
Receipt object: '{"orderId":"GPA...","packageName":"com....","productId":"ABC...","purchaseTime":158...,"purchaseState":0,"purchaseToken":"AAA...","autoRenewing":true,"acknowledged":false}',
Working (by adding subscription: true) '{"orderId":"GPA...","packageName":"com....","productId":"ABC...","purchaseTime":158...,"purchaseState":0,"purchaseToken":"AAA...","autoRenewing":true,"acknowledged":false,"subscription": true}',
Not sure if this will help someone in the future - but worked for me. Google API v3 requires it but I skimmed over it too fast.
{ packageName: 'The packge name of the item purchased', productId: 'The product ID of the item purchased', purchaseToken: 'PurchaseToken of the receipt from Google', subscription: true/false // if the receipt is a subscription, then true }
For me it was a string that had to be converted to an object first. Then it worked:
In node.js: // Check if receipt is a string and parse it as JSON if (typeof receipt === 'string') { try { receipt = JSON.parse(receipt); } catch (error) { // Handle parsing error console.error("Error parsing receipt JSON:", error); return res.status(400).send("Invalid receipt format"); } }
My code works perfect on Apple but I have troubles with Android:
this is the response
<Amazon> Validation failed: { status: 498, message: 'Invalid Purchase Token' }
the code:
I have this file from Android:
I used GOOGLE_CLIENT_EMAIL the client_email and GOOGLE_PRIVATE_KEY for private_key.
Any idea?
this is a purchase:
Thanks!