Now that we've got our action creator to post our token to the back end server we need to make sure
that it gets called whenever we get a token from the Strype checkout form.
So back inside of our component's directory I'll find the payments G-S file and we're going to import
both the connector helper and all of our action creators into this file and then hook them up to the
payments component.
So inside of here we'll import connect from re-act redux and we will port import star as actions from
up one directory actions.
OK so now we'll flip down to the bottom of the file where we will wire up the connect helper.
So connect the second set of parentheses.
We have no map state to prop's function here.
All we really care about is the action creators.
We'll pass those in as the second argument.
Now the very last step we need to make sure that after we get a token baktun stripe API we call our
action creator rather than just conc the logging out the token.
So we called our action creator handled tokin which means that the payments component has the actual
creator available on this props handle token.
So we would call this dot Propst dot handle token with the token.
All right.
I think we're ready to test this out now as a reminder we do not have a route handler on our server
put together yet.
So when we test this we're probably going to see some sort of 404 error but that's ok.
I just want to make sure that the request is actually being created.
So I'm going to go back over to my browser find the application.
It looks like the reload already kicked in on the chrome console if I select the network tab up here
and then I filter only by SH are requests I should be able to see the post request made after we go
through the add credits process.
So good to add credits.
We get prompted for our information.
So put in my e-mail.
Remember none of these inputs really matter.
They are not actually being used by stripe.
All that matters is that we put in the correct fake credit card number.
So we'll say for 2 4 2 4 2 4 2.
And then any date in the future and then any CBC will pay $5.
OK so we just got the token back.
And then as you can see we very shortly after that get an air from the route handler or the request
that we just made here is the request to API slash stripe in resulted in a 404 not found.
OK.
So I think that's looking pretty good.
I think that the front end of our application is now wired up as far as it can go in as far as actually
handling all this payment stuff.
We're now going to take a break.
When we come back we're going to change over to the server and create a route handler that's going to
take this token that we're attempting to push and exchange it for an actual charge through the strike
API.
So quick break.
Well take care of the server side in the next section.