59001 - "unknown web session id"
I'm implementing Transparent PagSeguro Checkout using PHP v2 API, however I always get the error above in the JavaScript part. Their support is horrible, there is nowhere else to go.
Edited: I've added the actual link so that testing can be done.
Follow the code:
function cartao(){
$(document).ready(function(){
var senderHash;
$.post('http://plimplimfestas.com/rafael/checkout.php', { sessao: "sessao" }, function(returnedData){
//TESTES
//*******************************************//
//***** Inicializando a sessão checkout *****// //*******************************************//
var xml = returnedData,
xmlDoc = $.parseXML(xml),
$xml = $(xmlDoc),
$title = $xml.find("id");
var idSess = $title.text();
console.log("SessionId");
console.log(idSess);
PagSeguroDirectPayment.setSessionId(idSess);
//***************************************//
//***** Obtendo o hash do comprador *****//
//***************************************//
var hashComprador = PagSeguroDirectPayment.getSenderHash();
senderHash = hashComprador;
//FIM TESTES
}).done(function(){
PagSeguroDirectPayment.getPaymentMethods({
success: function(response){ console.log(response); },
error: function(response){ console.log(response); },
complete: function(response){ console.log(response); }
});
throw "Stop forçado.";
//Os consoles de error e complete acima retornam o erro
/*
existem mais trechos, porém não passa do ponto acima
*/
}).fail(function(e){
console.error(e);
});
}); //document ready
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>