Example #1
0

	use_bearer_sandbox('v1', 'requests', array('product_id' => 'a1111c8c-c720-46c3-8534-2fcdd730040d', 'start_latitude' => '37.386358', 'start_longitude' => '-121.927910', 'end_latitude' => '37.377536', 'end_longitude' => '-121.911915' ));
	use_bearer_sandbox('v1', 'requests', array('product_id' => '', 'start_latitude' => '', 'start_longitude' => '', 'end_latitude' => '', ''));
	use_bearer_sandbox('v1', 'requests', array('status' => 'completed'), true);
	*/
// use_bearer_sandbox('v1', 'requests', array('product_id' => 'a1111c8c-c720-46c3-8534-2fcdd730040d', 'start_latitude' => '37.386358', 'start_longitude' => '-121.927910', 'end_latitude' => '37.377536', 'end_longitude' => '-121.911915' ));
// use_bearer_sandbox('v1', 'requests', array('status' => 'completed'), true);
// var_dump($_SESSION);
// if ($_POST['action'] == 'requestride') {
//
//   curl_get_code();
//   var_dump($_GET);
//   die();
//   $product_id = use_server_token('v1', 'products', '3GN0YfArYxQgZShl2aD2NgM0znBxYEAvhiTPwDen', array('latitude' => '37.400338', 'longitude' => '-121.882216'));
// 	$token = get_token(array('client_secret' => 'beewPLrpdUv8XsylE0wiRAkOIZaUbTw_pNE4DDu9', 'client_id' => 'Uh5Nhd87whQ0ZEyF0yK46_PXuAG-Ldps', 'grant_type' => 'authorization_code', 'redirect_uri' => 'http://localhost:8888/ride4kidz/bootstrap-3.2.0-dist/authorize.php', 'code' => "{$_GET['code']}"));
// 	$request_id = use_bearer_sandbox('v1', 'requests', array('product_id' => $product_id['products'][0]['product_id'], 'start_latitude' => '37.278615', 'start_longitude' => '-121.856369', 'end_latitude' => '37.376980', 'end_longitude' => '-121.912373'), $token['access_token']);
// 	$_SESSION['requestid'] = $request_id['status'];
//   $_SESSION['buttonid'] = $_POST['ride'];
//
//   header("Location: admin.html.php");
//
// }
if (isset($_GET['code'])) {
    $product_id = use_server_token('v1', 'products', '3GN0YfArYxQgZShl2aD2NgM0znBxYEAvhiTPwDen', array('latitude' => '37.400338', 'longitude' => '-121.882216'));
    $token = get_token(array('client_secret' => 'beewPLrpdUv8XsylE0wiRAkOIZaUbTw_pNE4DDu9', 'client_id' => 'Uh5Nhd87whQ0ZEyF0yK46_PXuAG-Ldps', 'grant_type' => 'authorization_code', 'redirect_uri' => 'http://localhost:8888/bootstrap-3.2.0-dist/authorize.php', 'code' => "{$_GET['code']}"));
    $request_id = use_bearer_sandbox('v1', 'requests', array('product_id' => $product_id['products'][0]['product_id'], 'start_latitude' => '37.278615', 'start_longitude' => '-121.856369', 'end_latitude' => '37.376980', 'end_longitude' => '-121.912373'), $token['access_token']);
    $_SESSION['requestid'] = $request_id['status'];
    // $_SESSION['buttonid'] = $_POST['ride'];
    header("Location: admin.html.php");
}
Example #2
0
function get_prices($start, $end)
{
    $start = get_geolocation($start);
    $end = get_geolocation($end);
    return use_server_token('v1', 'estimates/price', '3GN0YfArYxQgZShl2aD2NgM0znBxYEAvhiTPwDen', array('start_latitude' => $start->results[0]->geometry->location->lat, 'start_longitude' => $start->results[0]->geometry->location->lng, 'end_latitude' => $end->results[0]->geometry->location->lat, 'end_longitude' => $end->results[0]->geometry->location->lng));
}