Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- get a amount of balance, nexmo api.
- use Guzzle
- http://www.opencorebanking.com/
- $GOpciones is a array with API credentials
- */
- include_once("../config.php");
- require '../vendor/autoload.php';
- use Guzzle\Http\Client;
- use Guzzle\Http\EntityBody;
- use Guzzle\Http\Message\Request;
- use Guzzle\Http\Message\Response;
- $resultados = array();
- $resultados["error"] = true;
- $resultados["saldo"] = 0;
- $url = "https://rest.nexmo.com/account/get-balance?api_key=" . $GOpciones["api_key"] . "&api_secret=" . $GOpciones["api_secret"];
- $filesave = "/tmp/file.json";
- $cliente = new Client();
- $envio = $cliente->get($url, array(), array("save_to" => $filesave));
- $envio->setHeader('Accept', 'application/json');
- $envio->send();
- $cnt = file_get_contents($filesave);
- //echo $envio->getResponse();
- //echo $envio->getResponse();
- header('Content-type: application/json');
- echo $cnt;
- //echo json_encode($envio->getResponse());
- //var_dump($envio->getResponse());
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement