<?php
 
 
include $_SERVER['DOCUMENT_ROOT'] . '/PagSeguro/PagSeguro.Class.php';
 
 
$pedido_id = 813542;
 
 
/*    Cria o formulário para direcionar o usuário ao PagSeguro para efetuar o pagamento    */
 
$url_pagseguro = $PagSeguro->getCheckoutURL('[email protected]',
 
                                            'TOKEN_DE_SEGURANCA_CRIADO_NO_PAINEL_DO_PAGSEGURO',
 
                                            'PEDIDO-' . $pedido_id,
 
                                            'Julio Cezar Kronbauer', '[email protected]',
 
                                            '88', '8888-8888',
 
                                            PAGSEGURO_SHIPPING_TYPE_SEDEX,
 
                                            'Endereço do Cliente', '15321', NULL, 'Bairro do Endereço', '88888-888',
 
                                            'Cidade do Endereço', 'UF', 'Brasil',
 
                                            array(0 => array('description' => 'Camisa',
 
                                                             'amount' => 19.90,
 
                                                             'quantity' => 2,
 
                                                             'weight' => 150 /* Peso (em gramas) de um item, NÃO É a soma do peso dos itens */),
 
                                                  1 => array('description' => 'Calça',
 
                                                             'amount' => 89.90,
 
                                                             'quantity' => 1,
 
                                                             'weight' => 490)),
 
                                            'http://www.seusite.com.br/finalizar-compra/pedido/' . $pedido_id);
 
 
if ($url_pagseguro['error_code'] == 0) {
 
    @header("location: " . $url_pagseguro['checkout_URL']);
 
 
    echo '<script type="text/javascript">
 
        <!--
 
            location.href = "' . $url_pagseguro['checkout_URL'] . '";
 
        -->
 
        </script>';
 
}
 
/*    =================================================================================    */
 
 
?>
 
 |