Hi @avan-sardar, welcome!

find a topic based on uid and a custom session ID

Is this a requirement? If your plugin is listening for something like action:post.save, then you can process the stripe payment.

The action hook itself also sends the post data, which contains the pid and tid. Without more context, I am afraid I will not be able to help further.