1 00:00:01,010 --> 00:00:04,910 Before we move on from the exploration complete listener I do want to mention that you might notice 2 00:00:04,970 --> 00:00:07,030 a little hole in logic inside of your. 3 00:00:07,070 --> 00:00:11,810 At present we are saying that any time you receive the expiration complete events we are always going 4 00:00:11,810 --> 00:00:16,980 to set in order to canceled and this will be applied even if an order has already been paid for. 5 00:00:16,990 --> 00:00:20,990 So I want to point out that there is a little bit of a hole in here so we're going to first take care 6 00:00:21,050 --> 00:00:25,940 of our payment service and then once we had the idea of payments we're going to revisit this thing and 7 00:00:25,940 --> 00:00:31,490 make sure that we consider a order that has been paid for to be fully complete and that we should not 8 00:00:31,490 --> 00:00:34,010 cancel it after we have paid for it. 9 00:00:34,010 --> 00:00:34,280 Okay. 10 00:00:34,300 --> 00:00:37,160 So with all that might I bet you can guess what we're going to do next. 11 00:00:37,230 --> 00:00:37,970 Yep that's right. 12 00:00:37,970 --> 00:00:43,070 We're going to start to work on our payments service the payments service right here. 13 00:00:43,100 --> 00:00:47,810 I want to first begin by just getting a quick overview on what events this thing is going to be receiving 14 00:00:47,870 --> 00:00:53,540 and what it's going to be emitting the payment service is going to first receive any bent of order it 15 00:00:53,540 --> 00:00:59,580 created it will see this event just to tell it that hey here's some order expect to get a payment for 16 00:00:59,580 --> 00:01:00,210 it. 17 00:01:00,270 --> 00:01:04,860 The real goal of communicating order created over is to make sure that the payment service knows how 18 00:01:04,860 --> 00:01:10,810 much money in addition it should be receiving besides that the payment service is also going to listen 19 00:01:10,810 --> 00:01:11,100 for. 20 00:01:11,100 --> 00:01:12,180 Order canceled. 21 00:01:12,250 --> 00:01:15,780 So as soon as the order service emits a order it canceled the event. 22 00:01:15,880 --> 00:01:18,640 We're going to want to tell payments hey time to stop listening for events. 23 00:01:18,640 --> 00:01:24,020 If anyone tries to submit a payment just reject it. 24 00:01:24,110 --> 00:01:29,600 And then finally the payment service itself is going to emit a charge created event so charge created 25 00:01:29,600 --> 00:01:34,640 represents someone paying us some money for an order that church created is eventually going to go over 26 00:01:34,640 --> 00:01:39,410 to the order service and tell it that someone has paid for an order and we should market as paid or 27 00:01:39,410 --> 00:01:43,470 complete or whatever else that is the payment service. 28 00:01:43,470 --> 00:01:47,360 In a nutshell now obviously we have not really discussed and we won't for just a little bit. 29 00:01:47,370 --> 00:01:49,900 How are we going to actually accept payments. 30 00:01:49,920 --> 00:01:52,710 Yes we are going to handle actual credit card numbers and whatnot. 31 00:01:52,710 --> 00:01:57,360 This is gonna be a pretty realistic looking payment service but right now let's just do a little bit 32 00:01:57,360 --> 00:02:00,570 of initial setup on that thing so quick pause right here. 33 00:02:00,660 --> 00:02:04,490 When we come back the next video we're going to start to duplicate the ticket service again. 34 00:02:04,500 --> 00:02:07,390 Get all those dependencies do some community set. 35 00:02:07,530 --> 00:02:09,660 All that stuff that we are now very much used to doing.