We just signed up for the strike API and now on this API keys page we can see both a publishable key
and a secret key the secret key is the one that we want to make use of inside of our project.
This is what is going to allow us to reach out to the strike API and somehow charge a user's credit
card.
So we want to somehow use this key right here inside of our project.
But as you'd guess from the name of secret key we really do not want to put this secret right here in
plain text inside of our project.
Now this is something we have dealt with in the past and you might recall that in order to store some
secret information or some private keys inside of a Cuban I.D. cluster we can create an object called
a secret.
Secrets are used to store secret information just like an API key that we have right here.
We have created a secret once before inside this course.
So let's go back over to our terminal and create another secret that will store it.
This strike key okay.
So back in my terminal to create a secret we will write out cubes GTL read secret generic well then
put in the name of the secret.
So we're going to call it stripe dash secret then dash dash from literal and then we'll put in a collection
of key value pairs at the end of the command.
So we all write out stripe underscores key and then the value that we want to assign to this property.
In this case our key is the secret key we just saw inside of our browser.
It's going to take that secret key right there.
I'm going to copy it and then paste it at the very end.
All done run this and we can see that our secret has been created.
I should now be able to do a cube Seitel get secrets and I will see that I have a new secret called
stripe dash secret.
Now if you want to make use of this inside of our payment service we have to open up the deployment
file and tell communities that we want to take the information stored inside the secret and assign it
to the pod created by our payments deployment.
So let's do that right now.
Back inside my editor I will find the infra directory inside the K AIDS folder.
I'm going to find our payments deployment and I'll scrolling down a little bit to the environment section
deal those inside of here.
We've already got that Jason Webb token being assigned from a secret as well.
So we're going to essentially write out the same kind of block but we'll reference the SD stripe secret
that we just created a moment ago.
So I got to put in dash name is stripe underscore key then value from secret key ref the name of the
secret that we want to pull this value from is stripe dash secret and the name of the key is stripe
key.
So this is going to give us an environment variable available inside of our project called stripe underscore
key and that's going to make sure that we do not have to write out that entire secret key in plain text
which is definitely a fantastic improvement all right.
Now we've created that secrets.
Take another pause right here.
Well then make use of that environment variable and initialize the stripe SDK inside of our new account
handler in the next video.