-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing receipt data #209
Comments
Hello, Your Payload must also have a signature.
Cheers |
I try it already. But return
|
Hello, Your code here seems odd:
You choose to do one or the other not both. Would you have a look at this part of your code and see it the library is reading the public key correctly? Cheers |
Sorry, I forgot remove |
OK no problem. Could you run the same code with Cheers |
This is my error log
|
OK, |
I think the public key is correct. Because I have a game( I call this game is A in this post ) launched in google App Store, I used the another library to valid the receipt that call |
I see. Cheers |
Now, I just get the signature and receipt data in log console. I put these two datas in to server code for testing. So I don't do the client side part at this moment. |
I see. Thanks for reporting this issue by the way. Cheers! |
Hello, I just find the config |
Hello,
I am looking into the possibility that your receipt may require Google API to validate it. Cheers |
How to give me that version? |
I will update this repository's develop branch with the new version and you can git clone it and replace the inside of Cheers |
ok, are you update now? |
No I am still finishing it up. Cheers! |
OK, Thank you very much. |
Hello, I pushed the change to the develop branch. To test this version, you will have to change your code as follows: iap.config({
googleAPIKeyData: {
clientEmail: <client email from Google API service account JSON key file>,
privateKey: <private key string from Google API service account JSON key file>
}
});
iap.setup(function (error) {
if (error) {
// error
}
var receipt = {
packageName: <packageName from receipt JSON>,
productId: <productId from receipt JSON>,
purchaseToken: <purchaseToken from receipt JSON>,
subscription: false
};
iap.validate(receipt, function (error, result) {
// check here plz
});
}); |
If this works, I will make a proper update and publish it to npm! Cheers |
Hello, what is clientEmail and privateKey in config? |
They are included in your Google API service account key JSON file as Cheers |
It return this error. |
I think there is a bug in my update. I don't have my Google API account at the moment, so I am working blind. Please bear with me. Cheers |
@SQHK Could you |
yes. I got a latest code |
@SQHK is it still giving you the same error? |
yes |
@SQHK OK let me have another look real quick. |
@SQHK I pushed a change, would you please try git pull? |
yes. But I don't know why cannot be valid. |
That should not make any difference in terms of receipt validation.
Are you using the same Google API account as your other project?
…
On Sep 18, 2018 at 19:06, <SQHK ***@***.***)> wrote:
yes. But I don't know why cannot be valid.
The previous project is used the cocos2d-x and used the native code to implement the IAP.
And this project is used the Unity and used Unity IAP
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (#209 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ACKY4frOmAsiKp7Y2dYeJXMQHXJnkzR5ks5ucMWhgaJpZM4WpABA).
|
yes.
|
You have a line break (\n) at the end of your private key. Remove that and try please.
Cheers
…
On Sep 18, 2018 at 19:21, <SQHK ***@***.***)> wrote:
yes.
Do you help me to take a look in below code?
var iap = require('in-app-purchase'); iap.config({ googleAPIKeyData: { clientEmail: ***@***.***', privateKey: '-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCuP0JzGwZYfEjs\nB0hlCjeHRdCnhysjQEgD94kEuOCq2pQWnL50+Ugph1ZluG/HWQ5i4dPoVxc3ljZw\nyZWgZksZ98kDUEPeFEwkJ+raHWwCN4aPXdfO1h/mr/4USxWXPWmAso03Sb8xk1Fj\nueS/aMvkPXpfsBNkoPTbmpoPW+DCWiov2Y+9rAG1kNmMj61rT3UZcsIk6aVddH8N\nyLHLgDsiO+KKOuvSid2acLJrxj4NugRI5WOizRXZvc/3oPM8ylLVDWwbh+i95FJP\nSBABwNjyjmPUWjD8pFvEk0tuGJ5OEQoxRxwNiSisyJzHP4GrMCNEHYzaq95QIW4a\noyxBQvElAgMBAAECggEAGODw3qjw5MDoE4UtrbmB+Kc79bN7sgaLUb+t2VYBQ/u9\n8aWTHvX5uu43JIJrOUoKnw0x2aZXqwjgQIXTvolkdzJ1CatT6Vk6Dt6BLn/NbFqb\ntIwYVFCn0OL3ctPOox+yWN0FgyudKBmp4QSJd9fhZrbtakykVDWUCGfgT8mVQ4Jq\nTWXMm9JpgBB+yNoOFhVKSusjIthbRLYj7POFsi4f+ostDQxOe2uto68qgZTka/hg\ng02bf4QeWb18LlQrsXT+cGnrghczZc7MKvJHP54UIR09jFD0fvSX+rt9YxBZLpIk\ncGa/Hmqi33oNYSXD9Yl4Vkx5C0lk0Ne3/lakf3RO8QKBgQDcsbZ43U0PqKkLEvhf\nQFVgyYdeltbNgweIzZLhk15M8fi0US04zBECqa5NNvC5J5+0DdNvotirRXUxcDCE\nF7ViPojbl7jgv/mj4ZKHTYo3zP90PF4wfpu8/u11cmSMES66uqzPhOGwXHN5Fb/P\nWKjp21ad3PjIfsED+GwwosqpdQKBgQDKH1uT3Dt66WozfJIWohzZOBJYiW4BXGo/\n6vZwtlCO/zmYfZ4jM9P6UUrMp9hRAqun3KAbNv1tgOzasgbWM2DZRHQAR9/Q4oTK\n0ek1dHrQTrPDRzxca1FqgGsEzIYtcrIzROooY4kS2hIg+PnGIqOgM4yvUh2kxefX\n7a7MAzyC8QKBgBizTy/x3Nke0GSr596JTcT6aUs96KaxvpsiHwlePBSylFpiJ4SO\n2myI3zhHKOQgOjClx39cI5HvwTEaVGPEX4myZBDnx0poUiF0crjwBcM/D2xMAWK+\nGOIrShp2BijjF27Qy9yiC7x4bHgl5gTn8GfUI7qha7rM7P9rw3giEDqtAoGBAL1s\nE9wHeqrfE4t7BEI33YdpODBHY5Pc8ypB3oGVKvxIjsate0WMbe3av5n69ww8z3h6\nmIXIzEsSl2cBjsyxy+LydzBIK6ZMk5ysir1xEyQjje7F1PjcDqob/a+6qUjwg7bu\nr+/4EF9dhb3m99ZLYkNh7EfmUie43WWMt9M0eUJRAoGAfzYsNvRGSbqQ34e0rW/Q\n+3N6ggdrZkjPg1Va6knfEhVsB2trkS04Y4LZcPmMb9twzmpjqnLQO+ngwvrdRets\nvVXRugExkgRkQ6GX3Eu3od196LIjhjN/gyPcSn4doMGHxMYSQet51vS0h2jleUXK\n/Xk2tRruXhhaVI68eI2c+0s=\n-----END PRIVATE KEY-----\n' } }); let tr = {"orderId":"GPA.3312-4687-1696-11725","packageName":"com.sidequest.notification","productId":"test_gem_tier1","purchaseTime":1537263291006,"purchaseState":0,"purchaseToken":"anffecohieidgephpiigkgka.AO-J1OyENSiLLvZjJ-azlPpKzAe5LZRUjz-8HF_eH8a1bYjSah-i6EWyfjNIZu-E-qGkZePxZU6zCMRj9ZvVPqmJ1NfScN2NOgZVwO9CttSzPmIVI_mhwaU0A1Fj76h51wfCC8sKYR81"}; let ts = 'g65+pxRYD7NuvvfzY9TEVS50Zu8pLVTEoJXmZvtDuerYvD3dvT0EWfhhXAT2xeFCZR4Z6gqZXaDtqO6eCDzbWdhDYU/+76/Kgjppc9p3NR/f2yvBmwow1n6ZwaNo1uE0pGQ732CITIYsosJXOpo/IU84FM3D1f4/cF3h0QRNmuXBnYu5NwZ1mnHkaA2Vh5oZNaV0YKbKcS5ZRis4F62Tmuj2zERX3TTetnnABmKvQ0PMHL/0Zk3aPXHvFVPuzmIGbQnJR+UDLRAdFsEaxSW1MTDOAvXRQJEErqkCCd7juwLHquwsczX0d1muQ2NFVXJYJ4in082hvItDamPh+4e38Q=='; let json = tr; var receipt = { packageName: json.packageName, productId: json.productId, purchaseToken: json.purchaseToken, subscription: false } iap.setup(function (error) { if (error) { // error } iap.validate(receipt, function (error, result) { // check here plz if(error) throw error; }); });
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (#209 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ACKY4bSxTvX_vUNmYOvunzQq0TYYCvcsks5ucMkzgaJpZM4WpABA).
|
Not work. It always return |
It means that you haven’t given this account enough permission to validate receipts.
I suggest you have a look at your google API account and make sure you have the right permissions.
Cheers
…
On Sep 18, 2018 at 19:29, <SQHK ***@***.***)> wrote:
Not work. It always return Status: 403
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (#209 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ACKY4Uoh_nXXJRFlcK9L3uA5J73eyKZoks5ucMshgaJpZM4WpABA).
|
I check the Google API console many times. But I don't know where can set the permission. |
I will test it with your data and see if I can find out what the problem is.
I’m in transit now, it might take some time for me to get back to you but I will have a look.
Cheers
…
On Sep 18, 2018 at 19:33, <SQHK ***@***.***)> wrote:
I check the Google API console many times. But I don't know where can set the permission.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (#209 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/ACKY4YS2OEykl31LWQU3X5a3gShAopX1ks5ucMv8gaJpZM4WpABA).
|
No problem. I am off work now. So I will reply you in tomorrow. |
@SQHK Here is the log of what I get from Google:
|
Hello, do you know where can set the permission in Google API? |
@SQHK Cheers |
Is it in Google Play Developer Console? |
@SQHK |
I set that account can "View Financial Reports". Is the setting has the processing time? |
That I am not sure. |
I changed the permission. But the server still return the status code 401 |
@SQHK |
I changed it to Finance |
@SQHK |
@SQHK If you haven't done what it says above, it will lead to 401 error just like you see. |
Do you mean the pervious project? |
@SQHK |
Sorry, for late reply. |
Hello,
It is no any error return. And it has a response |
@SQHK Great! I am closing this is issue if there no more problem on your end. Cheers |
Hello, I am using Unity to do the IAP. And return the android receipt. I followed this instruction. But I cannot be valid my receipt.
Issue
Please help. Thanks
The text was updated successfully, but these errors were encountered: