Пример #1
0
 /**
  * @param Processor $processor
  */
 public function checkout(Processor $processor)
 {
     foreach ($this->getItems() as $item) {
         $processor->add($item->getPrice());
     }
     $payment = $this->isCredit ? $this->factory->getCredit() : $this->factory->getCash();
     $processor->pay($payment);
 }