Beispiel #1
0
 public function postProcess()
 {
     $validate = new PagSeguroValidateOrderPrestashop($this->pagSeguro);
     try {
         $validate->validate();
         if ($this->checkout) {
             die($validate->request($this->checkout));
         }
         try {
             Tools::redirectLink($validate->request($this->checkout));
         } catch (Exception $e) {
             $this->displayErrorPage();
         }
     } catch (PagSeguroServiceException $exc) {
         $this->canceledOrderForError();
         $this->displayErrorPage();
     } catch (Exception $e) {
         $this->displayErrorPage();
     }
 }
 * needs please refer to http://www.prestashop.com for more information.
 *
 *  @author    PrestaShop SA <*****@*****.**>
 *  @copyright 2007-2014 PrestaShop SA
 *  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *  International Registered Trademark & Property of PrestaShop SA
 */
include_once dirname(__FILE__) . '/../../../../config/config.inc.php';
$checkout = Configuration::get('PAGSEGURO_CHECKOUT');
include_once dirname(__FILE__) . '/../../pagseguro.php';
include_once dirname(__FILE__) . '/../../backward_compatibility/backward.php';
include_once dirname(__FILE__) . '/../../features/validation/pagsegurovalidateorderprestashop.php';
$pag_seguro = new PagSeguro();
$validate = new PagSeguroValidateOrderPrestashop($pag_seguro);
try {
    $validate->validate();
    if ($checkout) {
        die($validate->request($checkout));
    }
    Tools::redirectLink($validate->request($checkout));
} catch (PagSeguroServiceException $exc) {
    canceledOrderForErro($pag_seguro);
    if ($checkout) {
        throw new Exception($exc->getMessage(), 1);
    } else {
        displayErroPage();
    }
}
function displayErroPage()
{
    $showView = new BWDisplay();