');
break;
default:
$this->_mOrderProcessStage = 100;
throw new Exception('Unknown pipeline section requested.');
}
}
CHAPTER 19 ?– IMPLEMENTING THE ORDER PIPELINE: PART 2 610
If the order has been completed or an unknown section is requested, we generate an exception.
The test code gives us the additional opportunity of testing this exception generation, because if we run it again,
we??™ll be processing an already completed order. Click the Process Order button for an order that??™s already complete
(has the status 8), and you should get an error e-mail, as shown in Figure 19-6.
Figure 19-6. Order processing error e-mail
The error message mailed to the administrator should be enough to get you started on your way to finding out
what happened.
Updating the Checkout Page
In the previous example, we were forced to call the OrderProcessor::Process() method three
times in a row from the order details administration page. In practice, this won??™t happen??”the
method will be called once by presentation/checkout_info.php when a customer places an
order and twice more by the supplier in presentation/admin_order_details.php. We??™ll need to
modify these web pages accordingly.
Follow the steps in this exercise to make checkout_info.php work with the new order
pipeline.
Exercise: Updating the Checkout Process
1. Modify the init() method in the CheckoutInfo class in presentation/checkout_info.
Pages:
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726