/home/desid573/public_html/gcdriver
Edit: /home/desid573/public_html/gcdriver/test2.php (932B)
setHost("https://connect.squareupsandbox.com");
$api_config->setAccessToken($access_token);
$api_client = new \SquareConnect\ApiClient($api_config);
$customersApi = new SquareConnect\Api\CustomersApi($api_client);
$body = new \SquareConnect\Model\CreateCustomerCardRequest();
// Set the card nonce value for your request object.
$body->setCardNonce("cnon:CBASEPC24f9O-3Fw_J3t0ABsM38");
//$body->setCardNonce("AXTKZ34RXCRTSAJKC8T8P91630");
//print_r($body);
try {
$result = $customersApi->createCustomerCard("AXTKZ34RXCRTSAJKC8T8P91630", $body);
print_r($result);
echo $result["card"]["id"];
} catch (Exception $e) {
print_r('Error when calling createCustomerCard: '.$e->getMessage());
return "error";
}
?>