Skip to content
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
composer.json
item-management.php
payments-report.php
webhooks.php

README.md

Connect v1 examples: PHP

The samples in this directory demonstrate basic use of Square Connect API v1 in PHP. Before you run any of these samples, be sure to complete the steps described below.

Setup

Download Composer and Unirest

These samples require the Unirest HTTP library for PHP, which you install via Composer.

First, download Composer in this directory with the instructions on this page.

After you've downloaded Composer, install the Unirest dependency with the following command from this directory:

php composer.phar install

Specify your application credentials

In order for these samples to work, you must provide new values for variables with the value REPLACE_ME. Most commonly, you must provide your personal access token, which is available from the application dashboard.

See the comments in each sample for details.

Run item-management

php item-management.php

Run webhooks or payment-report

php -S localhost:8000

Visit localhost:8000/payment-report.php or localhost:8000/webhooks.php

You can’t perform that action at this time.