Created
October 2, 2017 17:12
-
-
Save tristansokol/175b0db72e97305f607369d1b95313d1 to your computer and use it in GitHub Desktop.
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 | |
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