Skip to content

Instantly share code, notes, and snippets.

@tristansokol
Created July 19, 2017 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tristansokol/423c10fdf6d3cf7c5e406cac1aa0de21 to your computer and use it in GitHub Desktop.
Save tristansokol/423c10fdf6d3cf7c5e406cac1aa0de21 to your computer and use it in GitHub Desktop.
sandbox dashboard pt3
<?php
//Start a session with the client
session_start();
require('vendor/autoload.php');
//Check for some basic errors.
if (!isset($_POST['customerId'])) {
echo "No customer id was supplied";
}
if (!isset($_SESSION["at"])) {
echo "Access token isn't set";
}
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken($_SESSION["at"]);
$api_instance = new SquareConnect\Api\CustomersApi();
$customer_id = $_POST['customerId']; // string | The ID of the customer to delete.
try {
$result = $api_instance->deleteCustomer($customer_id);
echo "deleted";
} catch (Exception $e) {
echo 'Exception when calling CustomersApi->deleteCustomer: ', $e->getMessage(), PHP_EOL;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment