Skip to content

Instantly share code, notes, and snippets.

@tristansokol
Created October 2, 2017 17:12
Show Gist options
  • Save tristansokol/175b0db72e97305f607369d1b95313d1 to your computer and use it in GitHub Desktop.
Save tristansokol/175b0db72e97305f607369d1b95313d1 to your computer and use it in GitHub Desktop.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
SquareConnect\Configuration::getDefaultConfiguration()->setAccessToken('XXXX');
$customers_api = new SquareConnect\Api\CustomersApi();
$customer = new \SquareConnect\Model\CreateCustomerRequest();
$customer->setGivenName('Stacy');
$customer->setFamilyName('Smith');
$customer->setEmailAddress('[email protected]');
$customer->setAddress(
array(
'address_line_1'=>'123 Main St.',
'locality'=>'Anywhere',
'country'=>'US'
)
);
try {
$result = $customers_api->createCustomer($customer);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling CustomersApi->createCustomer: ', $e->getMessage(), PHP_EOL;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment