Download api PagSeguro em php puro Clique Aqui
<?php
// PHP 7.0
//c?digo desenvolvido por Maycon Braga - mayconbraga.com.br
//d?vidas: mayconbraga@plataformafly.com.br
//Instagram: https://www.instagram.com/maycon_bragaa/
?>
<?php
$curl = curl_init();
$url_ambiente = '1';
if($url_ambiente == '1'){
$url_transacao = 'https://sandbox.api.pagseguro.com/charges/fees/calculate?payment_methods=CREDIT_CARD&value=10000&max_installments=10&max_installments_no_interest=0&credit_card_bin=552100'; //TESTES
} else {
$url_transacao = 'https://api.pagseguro.com/orders';//PRODUCAO
}
curl_setopt_array($curl, array(
CURLOPT_URL => $url_transacao,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'content-type: application/json',
'Authorization: Bearer token'
),
));
$response = curl_exec($curl);
$resultado = json_decode($response);
//var_dump($response);
curl_close($curl);
foreach ($resultado->payment_methods->credit_card->mastercard->installment_plans as $parcela) {
echo $parcela->installments.' - '.$parcela->installment_value.'<br>';
}