PHP 7.4.33
Preview: burq.php Size: 4.71 KB
/home/godevadmin/public_html/include/burq.php

<?php 
error_reporting(E_ALL);
//Configuration
define('burq_quote',"https://api.burqup.com/v1/quote");
define('burq_create_delivery',"https://api.burqup.com/v1/delivery_information");
define('burq_initiate_delivery',"https://api.burqup.com/v1/initiate_delivery");
define('burq_get_single_delivery',"https://api.burqup.com/v1/delivery/");
define('burq_list_delivery',"https://api.burqup.com/v1/deliveries");

if(SITE_URL=='https://www.quicklly.com'){
  //prod
define('burq_key',"715c1c75-5a13-40c4-992f-52e91cf0b24b");
}else{
  //sandbox
define('burq_key',"3c55c184-d8ea-47e4-aef3-1ab7d14a70b4");
}
//echo burq_key;
function curl_response($curl){
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
  return $err;
} else {
 return $response;
}
}

function burqquote($pickup,$dropoff){
$curl = curl_init();
curl_setopt_array($curl, [

  CURLOPT_URL => burq_quote,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_SSL_VERIFYPEER => FALSE,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"pickup_address\":\"$pickup\",\"dropoff_address\":\"$dropoff\"}",

  CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Content-Type: application/json",
    "x-api-key: ".burq_key,
  ],
]);
return curl_response($curl);
}

//burqquote('125 Western Ave, Allston, MA, 02134','127 Western Ave, Allston, MA, 02134');
function create_delivery($pickup,$dropoff,$item_list,$d_name,$d_phone,$d_notes,$p_name,$p_phone,$p_notes,$tip,$order_desc,$order_id){
$item_list=json_encode($item_list);
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => burq_create_delivery,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_SSL_VERIFYPEER => FALSE,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"items\":$item_list,\"pickup_address\":\"$pickup\",\"dropoff_address\":\"$dropoff\",\"dropoff_name\":\"$d_name\",\"pickup_name\":\"$p_name\",\"dropoff_phone_number\":\"+1$d_phone\",\"pickup_phone_number\":\"+1$p_phone\",\"dropoff_notes\":\"$d_notes\",\"pickup_notes\":\"$p_notes\",\"tip\":$tip,\"items_description\":\"$order_desc\",\"external_order_ref\":\"order #$order_id\"}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-api-key: ".burq_key,
  ],
]);

return curl_response($curl);
}

//create_delivery('125 Western Ave, Allston, MA, 02134','127 Western Ave, Allston, MA, 02134');

function initiate_delivery($identifier){
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => burq_initiate_delivery,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_SSL_VERIFYPEER => FALSE,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{\"deliveryInfoId\":\"$identifier\"}",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-api-key: ".burq_key,
  ],
]);
return curl_response($curl);
}

//initiate_delivery('40efp38jl1x8rzhw');

function get_single_delivery($identifier){
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => burq_get_single_delivery.$identifier,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_SSL_VERIFYPEER => FALSE,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-api-key: ".burq_key,
  ],
]);

return curl_response($curl);
}

function cancel_delivery($identifier){
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => burq_initiate_delivery.$identifier."/cancel",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_SSL_VERIFYPEER => FALSE,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "x-api-key: ".burq_key,
  ],
]);

return curl_response($curl);
}

function list_delivery(){
$curl = curl_init();
curl_setopt_array($curl, [
  CURLOPT_URL => burq_list_delivery,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_SSL_VERIFYPEER => FALSE,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => [
    "Content-Type: application/json",
    "x-api-key: ".burq_key,
  ],
]);

return curl_response($curl);
}

?>

Directory Contents

Dirs: 1 × Files: 25

Name Size Perms Modified Actions
ckeditor DIR
- drwxrwxr-x 2023-11-07 20:00:00
Edit Download
649 B lrwxrwxr-x 2023-11-07 19:59:58
Edit Download
649 B lrwxrwxr-x 2023-11-07 19:59:58
Edit Download
4.71 KB lrwxrwxr-x 2023-11-07 19:59:58
Edit Download
4.10 KB lrwxrwxr-x 2025-01-22 14:39:16
Edit Download
3.97 KB lrwxrwxr-x 2023-11-22 20:59:28
Edit Download
4.04 KB lrwxrwxr-x 2024-02-22 09:17:20
Edit Download
73.66 KB lrwxrwxr-x 2023-11-07 19:59:58
Edit Download
46.75 KB lrwxrwxr-x 2023-11-07 19:59:58
Edit Download
1.79 KB lrwxrwxr-x 2023-11-07 19:59:58
Edit Download
1.79 KB lrwxrwxr-x 2023-11-07 19:59:58
Edit Download
69.77 KB lrwxrwxr-x 2023-11-07 19:59:58
Edit Download
11.18 KB lrwxrwxr-x 2023-11-18 00:41:42
Edit Download
25.88 KB lrwxrwxr-x 2025-12-08 14:24:06
Edit Download
14.21 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
4.54 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
43.90 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
6.63 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
554 B lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
3.36 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
3.28 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
1.08 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
3.35 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
2.18 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
2.39 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download
15.41 KB lrwxrwxr-x 2023-11-07 20:00:00
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).