OK, so it's almost time to run a test transaction and see if we're saving all of the necessary information
to the database and I'm looking at handlers, don't go right now.
And if you recall last time I got rid of the capturing of the cardholder name in when when I read the
posted data.
So that means over here in succeeded dot page Digo HTML, I'm not going to be able to display that because
I don't have that information.
So we can actually change this to say customer name and instead we'll put first name and then indexed
data.
Last name here like that instead, which means back in handlers.
We need to save that to our map.
So we're calling the variables first name and last name.
And down here where I write to the map, I could just add that information data first name will be equal
to first name and data.
Last name will be equal to last name.
OK, so let's try this, see what we got wrong.
So I have nothing running so I'll type make start to get my application going.
Both the front and back end everything started.
That's encouraging.
Let's go back here, reload this page to make sure everything is current and try this out.
So Jack Jones, Jack somewhere, dot com Jack Jones
and four to four to the expiry of say zero three twenty nine A.B.C. of five five five.
Let's see if this works.
And I'm going to open the JavaScript terminal just to be safe.
So clearly the console and charge the card.
OK, so we managed to charge the credit card, but we got some kind of error here.
Let's see what we got wrong.
It's probably sequel.
It usually is field customer.
It doesn't have a default value.
This is in handler's go one for four.
So let's see where we got that wrong.
Handler's go one of four.
This is when we save the order and customer I.D. field customer I.D. doesn't have a default value.
So I must have left that somewhere.
One of four calls save order.
And save order calls, insert order, so widget I.D., transaction I.D., status I.D., quantity amount,
it looks like I need customer I.D. as well.
LEFT-TO-RIGHT, customer ID.
I'll put that right after quantity order that customer ID.
OK, so let's stop our application.
Make stop start our application.
Make start, try that again.
So back to our Web browser and I'll just go right to the home page so we can start this over.
And clear the console and go to products, buy one widget, and this time it's Sally Smith.
Sally Smith Dossie name on card is Sally Smith and the card number is our standard four to sequence.
Zero two 28 seven seven seven.
Let's try this again.
A different era this time, or maybe the same air we're about to find out, you have an area in your
school, Syntex, that corresponds to and this is starting back in server handler Stargirl, one of
four.
You have an area.
So, of course, I added that we have one, two, three, four, five, six, seven, eight values.
And I need a comma after customer ID, a mistake, which I make all the time.
So eight one, two, three, four, five, six, seven.
And we need an eighth one.
You probably saw that before I ran the code, but that's OK.
Mixed up mix start third time's the charm.
I hope so.
Back to our Web browser, back to the home page
and we'll try another one by one widget, Mark Smith, Mark at Smith Dossie and name Curtiz Mark Smith.
And the number is four two zero two twenty eight six seven eight.
Clear the console and charge the card.
And there it goes, so we have our payment intent, we have our customer name Mark Smith, we have the
email payment method is the correct format.
Payment amount is ten dollars or 1000 cents.
Currency is the last four digits for two for two.
Bank return code is exactly the form that I want and the expiry date.
Now the moment of truth.
Let's go check the database, which will probably have some partial transactions in there.
But that's OK.
So when the customers I definitely should see Mark Smith and I do actually have all three of them because
we got past that point.
No problem.
The next thing would be transactions.
So I should have at least one there for Mark Smith and I have three.
So all three of those worked.
And number three has a transaction status idea of three last four, no expiry month and no expiry year.
That's a bit of a problem.
So that's something we're definitely going to have to fix.
So I'll make a note of that expiry month and expire.
You're not getting inserted otherwise it seems pretty good.
So back under orders, I have one order, which is a transaction of three, which is correct.
That should go right to the correct transaction and the customer and the customer ID is the right one.
So the only thing that appears to be missing right now is expiry month and expiry year.
And that's not too bad.
So we'll take care of fixing that error and move on in the next lecture.