public function __construct() { parent::__construct(); $this->parcemaMinima = self::PARCELAMINIMA; $this->pay = new PagSeguroPaymentRequest(); $this->pay->setCurrency("BRL"); }
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()); } }