So I suspect you didn't have any difficulty with that, but let me show you how I did it in any case.
So I'm looking at the all sales page.
And if I look at order number seven, which has not been refunded and bring it up there it is charged
shows up properly, refund order shows up properly.
Let's try refunding that order and see if I get the correct response, refund order that's labeled properly.
And charge has been refunded and it says refunded up here and my button has disappeared.
Perfect.
Let's go back to the old subscriptions page and you can see that I already added a status column here
and it says canceled as it should.
So I need to create a new subscription so I can actually cancel it.
So let me go buy the products and we'll say subscription and we'll make this one.
Jimmy Olsen, Jimmy at the Daily Planet dot com, Jimmy Olsen.
And we'll buy a subscription to the bronze plan zero for twenty nine seven seven seven.
So I subscribe.
And if I go over to my striped dashboard, let's look at that subscription and those are found under
customers and I'll look at all subscriptions and you can see that I have one here for Jimmy at Daily
Planet that is currently active.
OK, so now let's go back here to the admin.
Look at all subscriptions.
Jimmy should show up and he's been charged and I can make it stay active if I want to.
But church works.
I'll bring up the order and now I'll cancel the subscription.
So this is the correct label.
This is the correct label.
It says charged up there.
So let's cancel it.
And it says subscription canceled.
And it says canceled up here, everything works as expected.
And if I go back to my striped dashboard and refresh this page, Jimmy subscription should now be canceled
on one month from today, cancels September the 5th.
Perfect.
OK, so that all worked.
So how did I do it?
Well, no surprises here.
Let's go back to our code.
All I did was add these two string map entries, one for the refunded badge, which it says refunded
here and refunded message, which says charge refunded.
And I did the same thing down here, but I made refunded badge equal to cancelled and refunded message
equal to subscription canceled and then over in my sailed on page TML down here.
When I say show success I'm just looking up the index of refunded message for my spring map so we get
the right message in there and up at the top.
I changed this on line nine in my code to be index refunded Benge from Strimmer and that's all I did
there.
And then finally for all subscriptions page almost exactly the same logic as the old sales page.
I added a status column up here in the T head of my old subscriptions table and down here I made a simple
decision.
If the status ID of the current record I'm looking at is not equal to one, make it say canceled.
Otherwise, make it say charged and that is it.
All right.
Time to move on to the next section.