8
I made the implementation of a virtual store customized in PHP language and as checkout I am using Paying.
In the implementation, the transparent checkout was used and was working correctly, but the client requested that the option of parceling the order be added. When trying to carry out parcel requisition using the API Javascript, the answer is always the same:
{"errors":{"INVALID SESSION: d4d905b585ec4d4d8056e380df70e4a5.":" 10005"},"error":true}
To make this request I am using the following Javascript method:
PagSeguroDirectPayment.getInstallments
I would like a help to solve, because as I said earlier the checkout was working correctly and the only change made was the addition of the installments.
Methods used
Return of the getSessionId
{"result":true,"date":"b099c6f4beff41e0a08a4912f7ce9554"}
Search card flag
PagSeguroDirectPayment.getBrand({
cardBin: $scope.pagamento.cartao,
success: function(response) {
if (response && response.brand && response.brand.name) {
$scope.bandeira = response.brand.name;
$scope.getParcelasCartao();
}
},
error: function(response) {
console.log(response);
}
});
Search for means of payment
PagSeguroDirectPayment.getInstallments({
amount: valor,
maxInstallmentNoInterest: 2,
brand: $scope.bandeira,
success: function(response) {
console.log(response);
if (response.error == false) {
$scope.parcelamento = response.installments[$scope.bandeira];
}
},
error: function(response) {
console.log(response);
$scope.parcelamento = new Array();
},
complete: function(response) {
}
});
Parameters that are sent in the request to fetch the installment
sessionId: b099c6f4beff41e0a08a4912f7ce9554
amount: 49.90
creditCardBrand: visa
maxInstallmentNoInterest: 2
Return of the search:
{"errors":{"Invalid session: b099c6f4beff41e0a08a4912f7ce9554.":" 10005"},"error":true}
If you can, post part of your code to help us help you :)
– Guilherme Nagatomo
Hello @Guilhermenagatomo, thanks for the suggestion. I already added the information and parameters sent in each request remembering that I am using the Javascript API of Pagseguro
– Diego Soek