We've now got some code in place to make sure that we should accept the payment that the user is trying
to provide to us.
So we've done all these validation steps.
It's now down here.
We're going to try to take the token that was provided inside this initial request.
Reach out to the stripe API and actually charge the users credit card.
Let's first take a look at a diagram.
Just help you understand exactly what's gonna go on with this step right.
Here we go.
We've got our payment service our ultimate goal is to reach out to the stripe API and charge the users
credit card for some amount.
At this point inside of our payment service inside that root HANDLER We just have a token which is an
authorization to charge the user for some amount of money in order to actually charge the users credit
card.
We're going to install the node J.S. stripe SDK.
So this is essentially an NPM module that has a little bit of code inside of it to allow us to very
easily communicate with the stripe API.
We're going to use this module and we're going to call a method inside there to charge the users credit
card.
When we do so we're going to provide the token that was included inside the request to our request handler.
And we're also going to include an API key that is going to identify our application to the stripe API
so to move forward we have to do two different things.
We have to install the stripe SDK into our payments project.
We also have to sign up for a stripe account and get an API key.
So we're going to go through both those steps inside this video.
Let's first install the stripe SDK back at my terminal.
I'm going to change into my payments directory and then do an npm install stripe.
That's pretty much it so I can run this command very small module should install rather quickly.
That was easy enough.
Next up we're going to go to the stripe Web sites sign up for an account and get an API key so to do
so inside of a new browser tab I'm going to navigate to stripe dot com now just you know the stripe
landing page and the documentation changes its look and theme rather frequently.
So if you come to this page and it looks different than what I see that is totally ok.
The stripe API itself rarely changes.
It's actually pretty famous for being a rather stable API.
So even if some stuff on this page looks a little bit different it's probably gonna be totally just
fine because the API itself is pretty darn stable so once a year we're going to try to create a new
account.
You can either click on sign in on the top right or just click the green start now button.
Well then sign up for a new account icon to create new account myself as well.
And it does not like my password.
There we go.
Good enough.
All right.
There we go really demanding on that password so once we sign in for the very first time we'll come
to a landing screen that looks like this.
The only thing we really want to do right now is try to find our API key.
The other thing we're going to have to do to see you know we have to verify our email address.
Do you will want to open up your e-mail.
You will get an e-mail from stripe.
It's probably going to look a little something like this right here.
So it says Just click this link.
Just make sure you do exactly what it says.
Just click on verify email address so once we have verified our account we're then going to either click
on it get test API key is right here.
If you do not see that link on the main page you can also find developers on the left tab click on developers
and then click on API keys.
Either way you will come to a page that looks like this and you're going to see a publishable key and
a secret key so we're going to leave this page open for just a moment.
We're going to take a pause right now and when we come back the next video we're going to set up the
stripe SDK inside of our project.