Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo "https://www.boletobancario.com/boletofacil/integration/api/v1/issue-charge?token=8D1472F01E481CE419FF94CB8C89625A322C721CAE91026AED573B741CFE60FD&description=2019041822003&amount=43.30&payerName=Marcos+Vinicius+Nascimento+Pereira&payerCpfCnpj=02039326170&payerEmail=mvnpereira@gmail.com".htmlentities('¬ifyPayer')."=true".htmlentities('¬ificationUrl')."=https://www.tecidosfabricart.com.br/index.php?option=com_boletofacilnotificacao&responseType=json&paymentTypes=BOLETO";
- $ch = curl_init();
- $options = array(
- CURLOPT_URL => "https://www.boletobancario.com/boletofacil/integration/api/v1/issue-charge?token=8D1472F01E481CE419FF94CB8C89625A322C721CAE91026AED573B741CFE60FD&description=2019041822003&amount=43.30&payerName=Marcos+Vinicius+Nascimento+Pereira&payerCpfCnpj=02039326170&payerEmail=mvnpereira@gmail.com".htmlentities('¬ifyPayer')."=true".htmlentities('¬ificationUrl')."=https://www.tecidosfabricart.com.br/index.php?option=com_boletofacilnotificacao&responseType=json&paymentTypes=BOLETO",
- CURLOPT_SSL_VERIFYPEER => false,
- CURLOPT_ENCODING => 'UTF-8',
- CURLOPT_POST => true,
- CURLOPT_RETURNTRANSFER => true,
- // CURLOPT_POSTFIELDS => $data,
- );
- curl_setopt_array($ch, $options);
- $response = curl_exec($ch);
- curl_close($ch);
- $resultado = json_decode($response);
- echo "<h1>Informações</h1>";
- echo "<h1>----------------</h1>";
- echo "<a href='https://www.boletobancario.com/boletofacil/integration/api/v1/issue-charge?token=8D1472F01E481CE419FF94CB8C89625A322C721CAE91026AED573B741CFE60FD&description=2019041822003&amount=43.30&payerName=Marcos+Vinicius+Nascimento+Pereira&payerCpfCnpj=02039326170&payerEmail=mvnpereira@gmail.com".htmlentities('¬ifyPayer')."=true".htmlentities('¬ificationUrl')."=https://www.tecidosfabricart.com.br/index.php?option=com_boletofacilnotificacao&responseType=json&paymentTypes=BOLETO' target='_blank'>Json Retornando ao acessar a URL direto.</a> mas não está funcionando com o CURL";
- echo "<pre>"; print_r($response); echo "</pre>";
- echo "<pre>"; print_r($resultado); echo "</pre>";
- $code = $resultado->data->charges[0]->code;
- $link = $resultado->data->charges[0]->link;
- $checkout = $resultado->data->charges[0]->checkoutUrl;
- echo "<pre>"; print_r($code);
- echo "<pre>"; print_r($link);
- echo "<pre>"; print_r($checkout);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement