This quickstart sample creates a Square client instance with your Square access token and then lists the locations in your account. The sample is based on the Ruby SDK Quickstart guide.
Install Ruby - If ruby -v
is not found as a command, install Ruby.
Install Ruby Bundler - If bundle -v
is not found as a command, install Bundler.
-
Change into the
quickstart
directory. -
Copy
.env.example
to.env
and replaceYOUR_ACCESS_TOKEN
with your Sandbox access token.SQUARE_ACCESS_TOKEN=EAAAEBRdRGhiYCNp8rwVzdcU-qbZuhsM55iGYH_EXAMPLE
-
In
Gemfile
, replacePLACE_VERSION_HERE
with the latest SDK version from here. -
Run the bundler to install local dependencies:
$ bundle install
-
Run the program:
$ rake run
-
In your console you should see output similar to this:
LHG1ZXJ8KSR8Z: Default Test Account, 1600 Pennsylvania Ave NW, Washington
Square Ruby SDK Guide - Details on how to configure and use the Square client.
Ruby Gem Repository for Square - Repo with the SDK package files.
Ruby SDK Source Code - Github repo with the source code.