How to hide stripe secret key using lambda function

I think you probably would benefit from reading this article:

So, my answer would be the same as @talves around making sure you access it as suggested.

Do note that functions do NOT use the variables mentioned in netlify.toml, only the ones shown in our UI.