Hi,
I''ve checked your requirements, I assume the thank you page is displayed after the purchase is done so we will have the unique order id and amount.
The unique order id, doesn't have to be PayPal id, it can be your site order id as long as it's unique.
Can you please tell me what framework do you currently use in your website?
Thanks.