示例#1
0
 public function checkout(PedidoPagamento $obj)
 {
     $this->tipoPagamento = (string) $obj;
     $obj->setReferencia($this->id);
     $obj->setEndereco($this->endereco);
     $obj->setCliente($this->idSessao);
     $obj->setDesconto($this->getDesconto()->num);
     $itens = new ListaPedidoItens();
     $a[1] = array('campo' => ListaPedidoItens::IDSESSAO, 'valor' => $this->id);
     $itens->condicoes($a);
     while ($i = $itens->listar()) {
         $obj->addItem($i);
     }
     try {
         return $obj->checkout();
     } catch (Exception $e) {
         throw new Exception($e->getMessage());
     }
 }