obanana_b2b_test/admin/vendor-delete-action.php

27 lines
660 B
PHP

<?php
include "../functions.php";
$urlCurrent = $_SESSION["url"];
$vendorId = $_GET['id'];
$curl = curl_init();
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/".$vendorId;
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'X-Api-Key: {{apiKey}}'
),
));
$response = curl_exec($curl);
curl_close($curl);
header("location: $urlCurrent");
echo $response;