Sorry
This has nothing to do with the 500 error you showed at first.
The 500 error was because your expression was calling a string “pid” and not a value from “pid” so that’s why the quotes.
The Id is missing in session response.
is related to the stripe checkout, so I don’t know how can I help you, my friend as I never implemented it
Check this:
Problems with stripe checkout
Id is missing in session response
Can you share your steps so others can see what is wrong with the stripe checkout?