1 00:00:01,040 --> 00:00:06,680 We just signed up for the strike API and now on this API keys page we can see both a publishable key 2 00:00:06,680 --> 00:00:11,820 and a secret key the secret key is the one that we want to make use of inside of our project. 3 00:00:11,840 --> 00:00:16,010 This is what is going to allow us to reach out to the strike API and somehow charge a user's credit 4 00:00:16,010 --> 00:00:16,970 card. 5 00:00:16,970 --> 00:00:20,240 So we want to somehow use this key right here inside of our project. 6 00:00:20,360 --> 00:00:25,550 But as you'd guess from the name of secret key we really do not want to put this secret right here in 7 00:00:25,550 --> 00:00:28,010 plain text inside of our project. 8 00:00:28,010 --> 00:00:32,210 Now this is something we have dealt with in the past and you might recall that in order to store some 9 00:00:32,210 --> 00:00:38,090 secret information or some private keys inside of a Cuban I.D. cluster we can create an object called 10 00:00:38,150 --> 00:00:39,150 a secret. 11 00:00:39,170 --> 00:00:44,600 Secrets are used to store secret information just like an API key that we have right here. 12 00:00:44,600 --> 00:00:47,040 We have created a secret once before inside this course. 13 00:00:47,090 --> 00:00:50,540 So let's go back over to our terminal and create another secret that will store it. 14 00:00:50,540 --> 00:00:54,390 This strike key okay. 15 00:00:54,420 --> 00:01:02,870 So back in my terminal to create a secret we will write out cubes GTL read secret generic well then 16 00:01:02,870 --> 00:01:04,790 put in the name of the secret. 17 00:01:04,820 --> 00:01:13,260 So we're going to call it stripe dash secret then dash dash from literal and then we'll put in a collection 18 00:01:13,260 --> 00:01:15,410 of key value pairs at the end of the command. 19 00:01:16,600 --> 00:01:23,500 So we all write out stripe underscores key and then the value that we want to assign to this property. 20 00:01:23,500 --> 00:01:28,110 In this case our key is the secret key we just saw inside of our browser. 21 00:01:28,170 --> 00:01:30,240 It's going to take that secret key right there. 22 00:01:30,240 --> 00:01:34,390 I'm going to copy it and then paste it at the very end. 23 00:01:36,070 --> 00:01:40,900 All done run this and we can see that our secret has been created. 24 00:01:40,900 --> 00:01:47,200 I should now be able to do a cube Seitel get secrets and I will see that I have a new secret called 25 00:01:47,260 --> 00:01:49,980 stripe dash secret. 26 00:01:50,100 --> 00:01:55,080 Now if you want to make use of this inside of our payment service we have to open up the deployment 27 00:01:55,080 --> 00:02:00,460 file and tell communities that we want to take the information stored inside the secret and assign it 28 00:02:00,460 --> 00:02:03,510 to the pod created by our payments deployment. 29 00:02:03,520 --> 00:02:04,760 So let's do that right now. 30 00:02:05,710 --> 00:02:10,960 Back inside my editor I will find the infra directory inside the K AIDS folder. 31 00:02:10,970 --> 00:02:17,420 I'm going to find our payments deployment and I'll scrolling down a little bit to the environment section 32 00:02:18,530 --> 00:02:19,580 deal those inside of here. 33 00:02:19,580 --> 00:02:24,610 We've already got that Jason Webb token being assigned from a secret as well. 34 00:02:24,770 --> 00:02:29,920 So we're going to essentially write out the same kind of block but we'll reference the SD stripe secret 35 00:02:29,950 --> 00:02:32,000 that we just created a moment ago. 36 00:02:32,230 --> 00:02:44,850 So I got to put in dash name is stripe underscore key then value from secret key ref the name of the 37 00:02:44,850 --> 00:02:53,240 secret that we want to pull this value from is stripe dash secret and the name of the key is stripe 38 00:02:53,420 --> 00:02:55,260 key. 39 00:02:55,320 --> 00:03:00,390 So this is going to give us an environment variable available inside of our project called stripe underscore 40 00:03:00,390 --> 00:03:06,180 key and that's going to make sure that we do not have to write out that entire secret key in plain text 41 00:03:06,240 --> 00:03:10,130 which is definitely a fantastic improvement all right. 42 00:03:10,180 --> 00:03:11,660 Now we've created that secrets. 43 00:03:11,730 --> 00:03:13,080 Take another pause right here. 44 00:03:13,110 --> 00:03:18,180 Well then make use of that environment variable and initialize the stripe SDK inside of our new account 45 00:03:18,180 --> 00:03:19,350 handler in the next video.