Server Side Purchase Validation


Sorry for the message, I hope I’m not making a duplicate topic.
I’m currently implementing in app purchase verification inside a golang module.
I used a plugin for the IOS part, without any problems. -> link to it.

Then when I tried to use the Android part, things started to become tricky. I used the sample with dummy values. No problem for compiling with Docker, but docker-compose up is throwing me errors when nakama try to load the golang module. Because it’s said the cause is different version of package, I checked the setup, I am using Golang 1.13 (tried updating to 1.14), Nakama 2.7.0, nakama-common 1.0.0
I also tried without the package, by using directly with google functions, but the same error is thrown right now.

So just by using this line : conf, err := google.JWTConfigFromJSON(byte(jsonKey), “”) and importing : “”, I got the same error from docker. Do you have any idea of the possible mismatch here?

Thank in advance for the answer.


PS : here is the docker error

"msg":"Could not open Go module","path":"/nakama/data/modules/","error":"plugin.Open(\"/nakama/data/modules/baccarat\"): plugin was built with a different version of package","stacktrace":"\n\\\n\\\n\\nmain.main\n\tmain.go:130\nruntime.main\n\truntime/proc.go:203"}

This indicates your plugin is importing a version of x/net that’s different to the one Nakama is compiled with. Go plugins require that all dependencies exactly match between the plugin and the application it’s loaded into.

Ensure your go.mod file and vendored dependencies match the versions your Nakama release is built with.

Thanks a lot for your answer.

To test more easily, I have disabled the external plugin, trying to use only Google functions for this time.
By modifying my go.mod as you said, I’ve been able to pass through the net/context/ctxhttp error, and also who came after. I found the good version to import by looking to go.mod file of the my current version of nakama (2.7.0) ->

I don’t know if it’s the correct workaround to ensure that dependencies are matching.

The problem is I still got the same error, but this time for, and this time this one is not listed in nakama go.mod.
Am I missing something to check the dependencies?

There are a number of transitive dependencies that are not explicitly listed in the go.mod file. Check Nakama’s vendor/modules.txt at the tag for your release for a full list of everything the server is built with.

You don’t need to match absolutely everything if it doesn’t appear at all in your plugin (or if your plugin uses dependencies Nakama does not) but where your plugin’s dependencies overlap with Nakama’s the versions must match exactly.

Thanks a lot for the answer, it took sometime, but I was able to make all the dependencies version to match.