简体   繁体   中英

Secure transactions with Express & Stripe

I'm trying to implement payments in my MEAN Stack application and I've seen that I need to provide my secret key as follows:

const stripe = require('stripe')(private_key)

However, I feel like this is not secure enough. Which is the best way to improve the security of this code? I guess there are many alternatives, so every piece of advice is welcome.

You can consider to put the value in an environment variable, and load it from here. Depends on the environment / backend stack you are using, you would have various way to configure environment variables.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM