WEBVTT 00:00.870 --> 00:06.210 OK, so it's almost time to run a test transaction and see if we're saving all of the necessary information 00:06.210 --> 00:09.930 to the database and I'm looking at handlers, don't go right now. 00:09.930 --> 00:16.890 And if you recall last time I got rid of the capturing of the cardholder name in when when I read the 00:16.890 --> 00:17.660 posted data. 00:18.360 --> 00:23.790 So that means over here in succeeded dot page Digo HTML, I'm not going to be able to display that because 00:23.790 --> 00:24.810 I don't have that information. 00:25.200 --> 00:36.670 So we can actually change this to say customer name and instead we'll put first name and then indexed 00:36.930 --> 00:37.480 data. 00:39.420 --> 00:45.180 Last name here like that instead, which means back in handlers. 00:45.180 --> 00:46.920 We need to save that to our map. 00:47.280 --> 00:49.800 So we're calling the variables first name and last name. 00:50.520 --> 01:00.960 And down here where I write to the map, I could just add that information data first name will be equal 01:00.960 --> 01:05.240 to first name and data. 01:05.270 --> 01:09.840 Last name will be equal to last name. 01:10.610 --> 01:13.020 OK, so let's try this, see what we got wrong. 01:13.440 --> 01:17.940 So I have nothing running so I'll type make start to get my application going. 01:17.940 --> 01:20.930 Both the front and back end everything started. 01:20.940 --> 01:21.740 That's encouraging. 01:22.380 --> 01:27.410 Let's go back here, reload this page to make sure everything is current and try this out. 01:27.420 --> 01:36.210 So Jack Jones, Jack somewhere, dot com Jack Jones 01:38.910 --> 01:48.830 and four to four to the expiry of say zero three twenty nine A.B.C. of five five five. 01:49.020 --> 01:50.220 Let's see if this works. 01:50.220 --> 01:53.490 And I'm going to open the JavaScript terminal just to be safe. 01:53.970 --> 01:58.050 So clearly the console and charge the card. 02:02.890 --> 02:07.070 OK, so we managed to charge the credit card, but we got some kind of error here. 02:07.090 --> 02:08.170 Let's see what we got wrong. 02:08.200 --> 02:09.220 It's probably sequel. 02:09.220 --> 02:12.480 It usually is field customer. 02:12.490 --> 02:14.700 It doesn't have a default value. 02:14.710 --> 02:16.750 This is in handler's go one for four. 02:16.750 --> 02:18.220 So let's see where we got that wrong. 02:18.220 --> 02:20.280 Handler's go one of four. 02:21.280 --> 02:29.170 This is when we save the order and customer I.D. field customer I.D. doesn't have a default value. 02:29.170 --> 02:31.090 So I must have left that somewhere. 02:31.780 --> 02:34.480 One of four calls save order. 02:38.460 --> 02:46.700 And save order calls, insert order, so widget I.D., transaction I.D., status I.D., quantity amount, 02:46.710 --> 02:48.630 it looks like I need customer I.D. as well. 02:48.630 --> 02:50.700 LEFT-TO-RIGHT, customer ID. 02:50.700 --> 02:55.380 I'll put that right after quantity order that customer ID. 02:56.770 --> 02:59.520 OK, so let's stop our application. 02:59.820 --> 03:02.640 Make stop start our application. 03:02.730 --> 03:04.770 Make start, try that again. 03:08.140 --> 03:13.630 So back to our Web browser and I'll just go right to the home page so we can start this over. 03:16.700 --> 03:24.980 And clear the console and go to products, buy one widget, and this time it's Sally Smith. 03:25.190 --> 03:34.220 Sally Smith Dossie name on card is Sally Smith and the card number is our standard four to sequence. 03:36.130 --> 03:39.360 Zero two 28 seven seven seven. 03:40.270 --> 03:41.160 Let's try this again. 03:46.620 --> 03:51.940 A different era this time, or maybe the same air we're about to find out, you have an area in your 03:51.940 --> 03:59.290 school, Syntex, that corresponds to and this is starting back in server handler Stargirl, one of 03:59.290 --> 03:59.550 four. 03:59.560 --> 04:00.210 You have an area. 04:00.220 --> 04:08.590 So, of course, I added that we have one, two, three, four, five, six, seven, eight values. 04:08.590 --> 04:12.330 And I need a comma after customer ID, a mistake, which I make all the time. 04:12.880 --> 04:16.840 So eight one, two, three, four, five, six, seven. 04:16.840 --> 04:18.100 And we need an eighth one. 04:18.670 --> 04:21.390 You probably saw that before I ran the code, but that's OK. 04:22.990 --> 04:29.200 Mixed up mix start third time's the charm. 04:29.200 --> 04:31.720 I hope so. 04:31.720 --> 04:35.320 Back to our Web browser, back to the home page 04:38.710 --> 04:51.670 and we'll try another one by one widget, Mark Smith, Mark at Smith Dossie and name Curtiz Mark Smith. 04:51.670 --> 04:58.500 And the number is four two zero two twenty eight six seven eight. 04:59.470 --> 05:02.740 Clear the console and charge the card. 05:07.180 --> 05:12.550 And there it goes, so we have our payment intent, we have our customer name Mark Smith, we have the 05:12.550 --> 05:15.520 email payment method is the correct format. 05:15.520 --> 05:18.190 Payment amount is ten dollars or 1000 cents. 05:18.490 --> 05:21.940 Currency is the last four digits for two for two. 05:21.940 --> 05:25.490 Bank return code is exactly the form that I want and the expiry date. 05:26.740 --> 05:27.940 Now the moment of truth. 05:27.940 --> 05:31.540 Let's go check the database, which will probably have some partial transactions in there. 05:31.540 --> 05:32.340 But that's OK. 05:33.100 --> 05:38.230 So when the customers I definitely should see Mark Smith and I do actually have all three of them because 05:38.230 --> 05:39.400 we got past that point. 05:39.400 --> 05:39.970 No problem. 05:40.390 --> 05:42.190 The next thing would be transactions. 05:42.190 --> 05:46.830 So I should have at least one there for Mark Smith and I have three. 05:46.840 --> 05:48.300 So all three of those worked. 05:48.730 --> 05:58.180 And number three has a transaction status idea of three last four, no expiry month and no expiry year. 05:58.300 --> 05:59.580 That's a bit of a problem. 05:59.590 --> 06:02.170 So that's something we're definitely going to have to fix. 06:02.170 --> 06:05.100 So I'll make a note of that expiry month and expire. 06:05.120 --> 06:08.760 You're not getting inserted otherwise it seems pretty good. 06:08.860 --> 06:16.930 So back under orders, I have one order, which is a transaction of three, which is correct. 06:16.930 --> 06:22.030 That should go right to the correct transaction and the customer and the customer ID is the right one. 06:22.300 --> 06:26.830 So the only thing that appears to be missing right now is expiry month and expiry year. 06:26.860 --> 06:27.760 And that's not too bad. 06:28.180 --> 06:32.530 So we'll take care of fixing that error and move on in the next lecture.