PsStockOk
This pipeline section just confirms that the supplier has the product in stock and moves on. Its
Process() method is called for orders whose stock was confirmed and that need to move on to
the next pipeline section. Add the following code to a new file in the business folder named
ps_stock_ok.php:
class PsStockOk implements IPipelineSection
{
public function Process($processor)
{
// Audit
$processor->CreateAudit('PsStockOk started.', 20300);
/* The method is called when the supplier confirms that stock is
available, so we don't have to do anything here except audit */
$processor->CreateAudit('Stock confirmed by supplier.', 20302);
// Update order status
$processor->UpdateOrderStatus(4);
// Continue processing
$processor->mContinueNow = true;
// Audit
$processor->CreateAudit('PsStockOk finished.', 20301);
}
}
?>
When this pipeline stage finishes, processing moves straight on to PsTakePayment.
PsTakePayment
This pipeline section completes the transaction started by PsCheckFunds. As with that section,
we only provide a dummy implementation here. Add the following code to a new file in the
business folder named ps_take_payment.php:
class PsTakePayment implements IPipelineSection
{
public function Process($processor)
{
// Audit
$processor->CreateAudit('PsTakePayment started.', 20400);
CHAPTER 19 ?– IMPLEMENTING THE ORDER PIPELINE: PART 2 598
// Take customer funds assume success for now
// Audit
$processor->CreateAudit('Funds deducted from customer credit card account.
Pages:
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717