Closed Callepo closed 10 months ago
Fixed
Fixed
was my change the fix? tried looking at commits, but dont see it yet in there
@insthync ?
hmm, even with that change, we still got the error when purchasing First this one
And then it says service not available.. But the thing we trying to purchase is a consumable, not subscription, so we should be able to buy it multiple times
Why service not available
still occuring, is there any error in server log?
The already own thing might be a message from Google Play, so I can't know why, maybe you should try ask Google Play
I see this.
But this is in Server Logs as Warning
Well i guess ill start here
Hmm, seems like I have to change its implementation, a new one will connects to external web-service, which uses https://github.com/voltrue2/in-app-purchase, also plan to store purchasing log to database by the web-service.
Hmm, seems like I have to change its implementation, a new one will connects to external web-service, which uses https://github.com/voltrue2/in-app-purchase, also plan to store purchasing log to database by the web-service.
that would be great yea. If it can log product bought with Cash would be cool too, aka when someone uses their cash to buy something in the shop, it records what they bought, so you have prove of them spending the cash.
Im also looking into making a General Logger for the game, like Dealings, Login , log out, location from login etc But im doing this on my own
@insthync After fixing the IAP Bug server side This is what we get now..
Client sends request to google to purchase cash.. W8's for response.. doesnt get it fast enough and times out.. SO when the response do come later on, its not processed, cuase its not listening anymore.. SO, server never processes the receipt, and u never get cash .. then the whole cash shop is bugged, u cant do anything anymore..
It Took 2 minutes for order to be processed.. Client Timed out long ago.. Cuase the Client didnt get the receipt, google refunds all purchases.
And then anything u try to do in the shop you get this..
Client shouldnt be responsible for processing this.. Server should be or an API.. Cuase it should keep listening for the response.. and not time out cuase it took longet than 10 seconds..
And what if my client crashes before i get my receipt?
The whole process is bad. I didnt find a single person who managed to get IAP working properly in the community.. Everyone using their own external API to purchase cash.. and just update the KIT DB cash on the account..
How did you fix it? just apply my commit? If yes, then why it will fix issues because the issues are from DefaultIAPReceiptValidator
which uses Unity's IAP system to validate receipts but it is not working on the current version, so I have to change the receipt validation.
How did you fix it? just apply my commit? If yes, then why it will fix issues because the issues are from
DefaultIAPReceiptValidator
which uses Unity's IAP system to validate receipts but it is not working on the current version, so I have to change the receipt validation.
I did not say it will fix the issue, im saying After applying the Server side Bug fix, its still not working because of others reasons, being the Receipt, i didnt even know the DefaultIAPReceiptValidator wasnt working on current version, i figured that out based on Testing and debugging.
But we know now its not working cuase im testing it
Ahh, I see, so it won't have anything fixed yet.
When u change something to it, let me know pls, so i can test it out. thank you <3
@insthync
More Crash Logs from IAP
As I said issues are from DefaultIAPReceiptValidator
, that error are from that component, if you want to fix it by yourself just try to validate the receipt, if you can't do it, then just wait for me to do it.
@insthync
More Crash Logs from IAP
The GooglePlayTangle.Data()
error used to happen if you did not setup/use obfuscated keys for google play store
https://docs.unity3d.com/Manual/UnityIAPValidatingReceipts.html.
Although a stupid question, are your google play keys correct setup and obfuscated ?
Also, as Suri mentioned, Unity's IAP is a bit insecure as its client-side validation and they themselves refer/link to https://github.com/voltrue2/in-app-purchase for server side validation (cause they donot provide it). But this package hasnt been updated in years and nodejs based.
It might be worth the effort to create our own server-side validation using direct GooglePlay/Apple APIs.
@Callepo can you try to run the unityIAPReceipt
through this https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.products/get
manually (browser/reqbin) ? If it works, I can help implement server-side validation using REST API (server->Google/Apple).
Relevant info I found for above approach.
https://stackoverflow.com/a/54658639
@shubhank008 Seems like Unity's IAP validation won't work on standalone platforms anymore, so DefaultIAPReceiptValidator
won't work anymore.
So I am just telling you guys to try to create your own validating component by implements IIAPReceiptValidator
interface, it may connect to the external web-service which may being developed by NodeJS with https://github.com/voltrue2/in-app-purchase for server-side validation, the https://github.com/voltrue2/in-app-purchase still fine.
But if you guys want to implement it by yourself then go ahead it is fine too, Or if you are going to use Google's API for validation by yourself at map-server (like as I did to DefaultIAPReceiptValidator
but this one is using Unity's IAP and currently not working) then it is okay too, might have to find JWT, base 64 decoding (and so on) libraries to implements it, I have an example to implements it: here.
What I've planned to do is: I will create a new component which implements IIAPReceiptValidator
interface, which when it is going to validate, it (map-server) will connect to web-service with receipt/user data to validate, if it is valid then it will store billing history to database and send success message to map-server to increase player's currencies, so I have to develop web-service for the validating too.
But I actually recommend you guys to create your own IAP system including product listing UIs (at client) because the built-in one was planned to make it work for both Offline and MMO games projects and it is hard to update product data, which you have to do it in Unity then build then upload.
Atm i just need the simplest and easiest one that works for now, and than i can take the time to check for any alternatives. Just need whats currently in kit to work for now cuase its a bit urgent, all the extra stuff i can do later or w8 how ever long idm.
" Seems like Unity's IAP validation won't work on standalone platforms anymore, so DefaultIAPReceiptValidator won't work anymore." Also not using standalone platforms, its all Mobile builds
As I said issues are from
DefaultIAPReceiptValidator
, that error are from that component, if you want to fix it by yourself just try to validate the receipt, if you can't do it, then just wait for me to do it.
i wasn't rushing you, u asked me for logs before, and i found logs so i shared it with you. Simply did what u asked. :)
Atm i just need the simplest and easiest one that works for now, and than i can take the time to check for any alternatives. Just need whats currently in kit to work for now cuase its a bit urgent, all the extra stuff i can do later or w8 how ever long idm.
" Seems like Unity's IAP validation won't work on standalone platforms anymore, so DefaultIAPReceiptValidator won't work anymore." Also not using standalone platforms, its all Mobile builds
I mean receipt validating by server, server builds are standalone platforms.
As I said issues are from
DefaultIAPReceiptValidator
, that error are from that component, if you want to fix it by yourself just try to validate the receipt, if you can't do it, then just wait for me to do it.i wasn't rushing you, u asked me for logs before, and i found logs so i shared it with you. Simply did what u asked. :)
It should not warn service is not available by logs you've shown me, because playerCharacterEntity.IsUpdatingItems should set to false so next request should not warn that message
@Callepo Where can I find this history
I can't find it in Google Play Console, and as I try I can't find "you already own this item" problems.
This history
The service is done, tested, work as intended
https://github.com/suriyun-mmorpg/mmorpg-kit-iap-validation-service
The service is done, tested, work as intended
https://github.com/suriyun-mmorpg/mmorpg-kit-iap-validation-service
Repo seems private, cannot access it
Okay, changed it to be public
This history
@insthync is it supposed to add cash to account even when doing sandbox mode for testing? Or only in live mode? Service is receiving receipt, ingame showing no errors everything fine, Log added to Db but the Status is 0 and Acknowledged is false.
Its not failing anymore and Refunding all the purchases.
Everything seems fine, just Status 0 and cash not added.
Should be added while it is in test mode, I did internal test.
Status 0 is success.
yea im looking through code now saw this
so figured 0 is good.. but no cash added to the player
Started with this amount, before purchasing.
it should have added all those amounts, but its stays the same
Should be added while it is in test mode, I did internal test.
We are also doing the same, Internal Testing
Try latest commit of MMO repo
Try latest commit of MMO repo RESTIAPReceiptValidator Error
Shouldnt it be
Like
Becuase this was removed
Pushed
@insthync
Still same 1300 cash
:(
There is literally 0 errors anywhere.. everything is passing and validating, the last piece just doesnt wanna work lol .. wtf This look good? I have the Cash amount set as 2000 or it needs to be somewhere else? cuase seems like its not getting the amount properly
Try to debug amount of ChangeCash
Try to debug amount of
ChangeCash
XD
Literally what i was doing, uploading build etc to try and buy again
nothing showed up in log files or console feel like it should have. i changed debug logs to logger to be sure
making new build now and testing again.
@insthync im retarded.. i have 2 Server build folders 1 for SEA Region and 1 for EU Region.. i did the changes in the project, made a build in the SEA folder And kept uploading EU build to the EU server, so none of the changes were added.. I uploaded the correct build now and it works .. FML..
Sorry
Nice
Nice
But yea ur latest commit 100% fixed it. its showing instantly now
Glad to see this fixed :) Thanks from my side as well to both of you!
The service is done, tested, work as intended
https://github.com/suriyun-mmorpg/mmorpg-kit-iap-validation-service
do i have to use this above package for this fixed to take effect?
@tubhluas Yes
The HandleRequestCashPackageBuyValidation has a bug i think.
The isupdatingItems in the other methods when its sending response to client all have it to false.. But this one is being set to true..
and i am checking this becuase when you buy cash ingame, you dont get the cash, and when u try to buy 2nd time, it tells u service not available.. Which is literally this