Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CURL EXAMPLE
- try {
- $url = "http://localhost/webservices/sac/faturas-site/$cpfcnpj";
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- $output = curl_exec($curl);
- $http_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
- curl_close($curl);
- if ($http_code == 200)
- {
- $response = json_decode($output);
- return view('processa-boleto-cpf', compact( 'response', 'cpfcnpj', 'tipo', 'http_code'));
- } else {
- throw new Aviso('Não foi possível encontrar alguma informação');
- }
- } catch (Exception $e) {
- throw new Aviso('Não foi possível encontrar alguma informação.');
- }
Advertisement
Add Comment
Please, Sign In to add comment