Olá galera do SB! Esse é meu primeiro tópico, e queria saber como resolver o problema do meu script: O problema é o seguinte, mostra esse erro: Notice: Undefined index: SHOP_ORDER_TOKEN in /home/bon/public_html/modules/checkout/pseguro/module.pseguro.php on line 130 Veja aqui o código do script: <?php
class CHECKOUT_PSEGURO extends ISC_CHECKOUT_PROVIDER
{
/**
* @var boolean Does this payment provider require SSL?
*/
var $_requiresSSL = false;
/**
* Checkout class constructor
*/
public function __construct()
{
parent::__construct();
$this->_name = "PagSeguro";
$this->_image = "logo.gif";
$this->_description = "Módulo de Pagamento Online Via PagSeguro";
$this->_enabled = $this->CheckEnabled();
$this->_height = 0;
$this->_paymenttype = PAYMENT_PROVIDER_OFFLINE;
}
function isaccessible()
{
// If bank deposit is available for all countries then return true
$available_countries = $this->GetValue("availablecountries");
if( (!is_array($available_countries) && $available_countries == "all") || (is_array($available_countries) && in_array("all", $available_countries)) ) {
return true;
}
else if(!isset($GLOBALS['ISC_CLASS_ACCOUNT'])) { // Always accessible to the Admin panel
return true;
}
else {
// Load the pending order
$pendingOrder = LoadPendingOrderByToken();
// Check the country in the billing address. If it's not set then assume true
if(isset($pendingOrder['ordbillcountryid'])) {
$billing_country_id = $pendingOrder['ordbillcountryid'];
if(is_array($available_countries)) {
if(in_array($billing_country_id, $available_countries)) {
return true;
} else {
return false;
}
}
else {
if($billing_country_id == $available_countries) {
return true;
} else {
return false;
}
}
}
else {
return true;
}
}
}
public function SetCustomVars()
{
$this->_variables['displayname'] = array("name" => "Nome",
"type" => "textbox",
"help" => 'Nome da forma de pagamento',
"default" => "PagSeguro",
"required" => true
);
$this->_variables['availablecountries'] = array("name" => "Continentes",
"type" => "dropdown",
"help" => GetLang('PagContinente'),
"default" => "all",
"required" => true,
"options" => GetCountryListAsNameValuePairs(),
"multiselect" => true
);
$this->_variables['email'] = array("name" => 'Email PagSeguro',
"type" => "textbox",
"help" => 'Ponha seu Email de Cadastro no PagSeguro - www.pagseguro.com.br',
"default" => "",
"required" => true
);
$this->_variables['comsem'] = array("name" => 'Com ou Sem Juros',
"type" => "textbox",
"help" => 'Insira neste campo o termo [com] ou [sem] para indicar se tem juros ou não',
"default" => "com",
"required" => true
);
$this->_variables['taxa'] = array("name" => 'Taxa de Juros',
"type" => "textbox",
"help" => 'Insira neste campo a taxa de juros<br>[Ex: 1.99 | Para 1,99%]',
"default" => "1.99",
"required" => true
);
$this->_variables['prestacoes'] = array("name" => 'Quantidade de Prestações',
"type" => "textbox",
"help" => 'Insira neste campo a quantidade de prestações<br>[Ex: 12 | Para 12x]',
"default" => "9",
"required" => true
);
$this->_variables['mostrar'] = array("name" => 'Exibir parcelamento(1 = Sim / 2 = Não)',
"type" => "textbox",
"help" => 'Insira neste campo o valor<br>[Ex: 1 vai mostrar o parcelamento]',
"default" => "1",
"required" => true
);
}
function getofflinepaymentmessage(){
$order = LoadPendingOrderByToken($_COOKIE['SHOP_ORDER_TOKEN']);
$query = sprintf("SELECT * FROM [|PREFIX|]customers WHERE customerid='%s'", $GLOBALS['ISC_CLASS_DB']->Quote($order['ordcustid']));
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$customer = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
$valorcobrado = $order['ordtotalamount'];
$taxa_jurospagseg = $this->GetValue("taxa_jurospagseg");
$valorarrumado = (($valorcobrado/100)*$taxa_jurospagseg)+$valorcobrado;
$apagar = number_format($valorarrumado, 2, ',', '');
$billhtml = "
<div class='FloatLeft'><b>PAGAMENTO COM PAGSEGURO</b>
<br>
Utilizamos o que há de mais moderno em soluções para manter a segurança durante sua compra.
Você irá efetuar o pagamento diretamente no Site Seguro do PagSeguro, com tecnologia de SSL 128 bits e com envio codificado dos seus dados.
Não será armazenado nenhuma informação como números, validades ou mesmo código de segurança de seu cartao, imediatamente destruídos logo após o processamento do pagamento.
Tais informações serão processadas diretamente pelo PagSeguro.
<p><br>
<b>PORTANTO, SUA COMPRA É SEGURA!</b>
<br>
Observação Importante: O pagamento será efetuado em uma nova janela.
Por favor, desabilite o Bloqueador Pop-up (janelas) para que possa prosseguir.
<br><br>
<form action='https://pagseguro.uol.com.br/security/webpagamentos/webpagto.aspx' method='post' target='_BLANK'>
<input type='image' src='".$GLOBALS['ShopPath']."/modules/checkout/pseguro/images/logo.gif' value='Pagar agora com PagSeguro'>
<br><br>
<p class='SuccessMessage'>Clique no botão do PagSeguro acima para processar o seu pedido #".$order['orderid']." pelo sistema do PagSeguro UOL.</p>
</div>
<input type='hidden' name='email_cobranca' value='" . $this->GetValue("email") . "'>
<input type='hidden' name='tipo' value='CP'>
<input type='hidden' name='moeda' value='BRL'>
<input type='hidden' name='item_id_1' value=01>
<input type='hidden' name='item_valor_1' value='" . $apagar . "'>
<input type='hidden' name='item_frete' value=0>
<input type='hidden' name='item_peso' value=0>
<input type='hidden' name='item_quant_1' value=01>
<input type='hidden' name='item_descr_1' value='Pedido #" . $order['orderid'] . "'>
<input type='hidden' name='cliente_nome' value='" . $order['ordbillfirstname'] . "'>
<input type='hidden' name='cliente_email' value='" .$customer['custconemail']. "'>
<input type='hidden' name='cliente_end' value='" . $order['ordbillstreet1'] . "'>
<input type='hidden' name='cliente_bairro' value='" . $order["ordbillsuburb"] . "'>
<input type='hidden' name='cliente_cidade' value='" . $order["ordshipsuburb"] . "'>
<input type='hidden' name='cliente_estado' value='" . substr($order["ordshipstate"],0,2) . "'>
<input type='hidden' name='cliente_cep' value='" . $order["ordshipzip"] . "'>
</form>
<br><br>";
return $billhtml;
@mail($customer['custconemail'], 'Formulário de Pagamento de Pedido - PagSeguro', $billhtml);
}
}
?> Desde já agradeço. :D