macOS DSN Configuration
This section shows how to set up ODBC connectivity and configure DSNs on macOS.
Minimum macOS Version
The CData ODBC Driver for Square driver requires macOS Sierra (10.12) or above.
Licensing the Driver
In a terminal, run the following commands to license the driver. To activate a trial, omit the <key> input.
cd "/Applications/CData ODBC Driver for Square/bin"
sudo ./install-license.sh <key>
You'll be prompted for a name and password. These refer to your name and your machine's password.
Connecting to Square
Set the LocationId property to specify a default business location. Or, set the LocationId in the search criteria of your query.
To retrieve the Id, query the Locations table after you authenticate.
Authenticating to Square
You can use a personal access token to authenticate to Square or use the OAuth standard. Use a personal token to access your own data or to test through the sandbox. Use OAuth to allow other users to access their own data.Personal Access Token
Set the OAuthAccessToken connection property to your personal token, which can be obtained by following the steps below:
- Navigate to the Developer Dashboard and see Create an OAuth App for creation guide.
- Once the app is created, the token is listed on the Credentials tab.
Square Sandbox
Version 2 of the Connect API allows you to test in a sandbox environment. Transactions created in the sandbox are not sent through to card networks, and cards are never charged.
To connect to the sandbox, set OAuthAccessToken to the sandbox access token, which is available alongside your standard personal access token:
- Navigate to the Developer Dashboard and see Create an OAuth App for creation guide.
- Once the app is created, the sandbox token is listed on the Credentials tab.
In addition to OAuthAccessToken, set Schema to "V2", UseSandbox to "True".
OAuth
OAuth requires the authenticating user to interact with Square using the browser. You can connect without setting any connection properties for your user credentials. When you connect the driver opens the Square OAuth endpoint in your default browser. Log in and grant permissions to the driver. The driver then completes the OAuth process.
Note: The driver is already registered with Square as an OAuth application and will automatically use its embedded OAuthClientId and OAuthClientSecret to connect. If you want to use your own custom OAuth app, see Create an OAuth App to obtain these connection properties.
Uninstalling the Driver
The easiest way to uninstall the driver is to open a terminal and run the included uninstall.sh script, located in the installation directory. For example:
cd "/Applications/CData ODBC Driver for Square" sudo ./uninstall.sh
Note: The script needs to be run from the installation directory.