简体   繁体   中英

Passing a secured value from controller to model

I'm currently trying to pass a value (POST variable) from my Controller to my Model. This is a secured Stripe token, so it should not be stored anywhere, but I noticed it is.

Currently the token in stored in the db and then the Model accesses it in the beforeSave() function, to create the Stripe Charge object. I would like to create this object without storing the token, knowing that this token is passed in a POST variable.

I can access it easily in my Controller, but I'm not sure how to get it in my model. I thought about creating customs function replacing the beforeSave one, and passing the token as an argument.

Is there a better way to do this?

Thanks a lot

I used a public variable in my model, however I'm not sure if it's considered as stored ? Can someone enlighten me on this? Thanks!

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