WEBVTT 00:01.340 --> 00:05.840 So I suspect you didn't have any difficulty with that, but let me show you how I did it in any case. 00:05.840 --> 00:07.550 So I'm looking at the all sales page. 00:07.550 --> 00:13.790 And if I look at order number seven, which has not been refunded and bring it up there it is charged 00:13.790 --> 00:16.670 shows up properly, refund order shows up properly. 00:16.670 --> 00:22.640 Let's try refunding that order and see if I get the correct response, refund order that's labeled properly. 00:24.680 --> 00:28.760 And charge has been refunded and it says refunded up here and my button has disappeared. 00:28.790 --> 00:29.300 Perfect. 00:29.870 --> 00:36.560 Let's go back to the old subscriptions page and you can see that I already added a status column here 00:36.560 --> 00:38.570 and it says canceled as it should. 00:38.980 --> 00:42.170 So I need to create a new subscription so I can actually cancel it. 00:42.350 --> 00:46.760 So let me go buy the products and we'll say subscription and we'll make this one. 00:47.930 --> 00:56.960 Jimmy Olsen, Jimmy at the Daily Planet dot com, Jimmy Olsen. 00:57.590 --> 01:03.560 And we'll buy a subscription to the bronze plan zero for twenty nine seven seven seven. 01:04.780 --> 01:05.660 So I subscribe. 01:10.660 --> 01:15.740 And if I go over to my striped dashboard, let's look at that subscription and those are found under 01:15.780 --> 01:22.990 customers and I'll look at all subscriptions and you can see that I have one here for Jimmy at Daily 01:22.990 --> 01:24.460 Planet that is currently active. 01:24.640 --> 01:27.830 OK, so now let's go back here to the admin. 01:27.850 --> 01:29.200 Look at all subscriptions. 01:29.230 --> 01:33.250 Jimmy should show up and he's been charged and I can make it stay active if I want to. 01:33.250 --> 01:34.140 But church works. 01:35.050 --> 01:38.710 I'll bring up the order and now I'll cancel the subscription. 01:39.700 --> 01:41.240 So this is the correct label. 01:41.410 --> 01:42.720 This is the correct label. 01:42.730 --> 01:44.310 It says charged up there. 01:44.350 --> 01:45.220 So let's cancel it. 01:47.270 --> 01:49.140 And it says subscription canceled. 01:49.160 --> 01:52.390 And it says canceled up here, everything works as expected. 01:52.400 --> 01:59.720 And if I go back to my striped dashboard and refresh this page, Jimmy subscription should now be canceled 01:59.720 --> 02:03.270 on one month from today, cancels September the 5th. 02:03.530 --> 02:04.040 Perfect. 02:04.250 --> 02:05.390 OK, so that all worked. 02:05.420 --> 02:06.230 So how did I do it? 02:06.260 --> 02:07.590 Well, no surprises here. 02:08.210 --> 02:09.130 Let's go back to our code. 02:10.310 --> 02:17.060 All I did was add these two string map entries, one for the refunded badge, which it says refunded 02:17.060 --> 02:20.510 here and refunded message, which says charge refunded. 02:20.870 --> 02:25.970 And I did the same thing down here, but I made refunded badge equal to cancelled and refunded message 02:25.970 --> 02:33.290 equal to subscription canceled and then over in my sailed on page TML down here. 02:33.680 --> 02:40.160 When I say show success I'm just looking up the index of refunded message for my spring map so we get 02:40.160 --> 02:42.530 the right message in there and up at the top. 02:45.740 --> 02:52.910 I changed this on line nine in my code to be index refunded Benge from Strimmer and that's all I did 02:52.910 --> 02:53.150 there. 02:53.270 --> 02:58.790 And then finally for all subscriptions page almost exactly the same logic as the old sales page. 02:58.820 --> 03:07.310 I added a status column up here in the T head of my old subscriptions table and down here I made a simple 03:07.310 --> 03:07.750 decision. 03:07.880 --> 03:13.730 If the status ID of the current record I'm looking at is not equal to one, make it say canceled. 03:14.220 --> 03:17.710 Otherwise, make it say charged and that is it. 03:18.050 --> 03:18.460 All right. 03:18.560 --> 03:20.330 Time to move on to the next section.