Hey!
For the 2021 stack, you need your own webserver to manage Apple's server2server events and link them to a user ID.
So you match user ID with the original transaction ID on the device, send it to the server and then match it with Apple events.
Or you can use 3rd party solutions that do all this job for you such as Adapty.io