Created
July 19, 2017 22:21
-
-
Save tristansokol/423c10fdf6d3cf7c5e406cac1aa0de21 to your computer and use it in GitHub Desktop.
sandbox dashboard pt3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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