PHPackages                             kdaviesnz/square - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. kdaviesnz/square

ActiveLibrary[Payment Processing](/categories/payments)

kdaviesnz/square
================

071

Since Jan 9Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kdaviesnz/square)[ Packagist](https://packagist.org/packages/kdaviesnz/square)[ RSS](/packages/kdaviesnz-square/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (1)

square
======

[](#square)

Install
-------

[](#install)

Via Composer

```
$ composer require kdaviesnz/square
```

Usage
-----

[](#usage)

```
$square = new \kdaviesnz\square\Square("sandbox-sq0atb-xrWTG_wv3dJqYTQaTKgovw");

		$result = $square->getLocations();

		$locationId = $result->locations[0]->id;

		/*
		// Only works for non-sandbox
		$result = $square->listAdditionalRecipientReceivables(
			$locationId,
			"2016-01-15T00:00:00Z",
			"2016-01-31T00:00:00Z"
		);

		$result = $square->listAdditionalRecipientReceivableRefunds(
			$locationId,
			"2016-01-15T00:00:00Z",
			"2016-01-31T00:00:00Z"
		);

		*/

		// Orders
		$idempotencyKey = uniqid();
		$referenceId = "testref";

		$lineItem = new \kdaviesnz\square\OrderRequestLineItem();
		$lineItem->setBasePriceMoney(new \kdaviesnz\square\Money(20.00, "USD"));
		$lineItem->setCatalogObjectId("abcde");
		$lineItem->setName("widget");
		$lineItem->setQuantity(10);
		$discount = new \kdaviesnz\square\OrderRequestDiscount();
		$discount->setAmountMoney(new \kdaviesnz\square\Money("5.00", "USD"));
		$discount->setPercentage(5.00);
		$discounts = array(
			$discount
		);
		$tax = new \kdaviesnz\square\OrderRequestTax();
		$tax->setPercentage(2.00);
		$taxes = array($tax);
		$result = $square->createOrder($locationId, $idempotencyKey, $referenceId, array($lineItem), $taxes, $discounts);

```

Change log
----------

[](#change-log)

Please see CHANGELOG.md for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see CONTRIBUTING.md and CODE\_OF\_CONDUCT.md for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

-

License
-------

[](#license)

The MIT License (MIT). Please see LICENSE.md for more information.

square
======

[](#square-1)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b63930ad10271ff6fe9e1ce3446ebc46b67edda7afc70fd09a3970f55215617?d=identicon)[kdaviesnz](/maintainers/kdaviesnz)

---

Top Contributors

[![kdaviesnz](https://avatars.githubusercontent.com/u/2062483?v=4)](https://github.com/kdaviesnz "kdaviesnz (2 commits)")

### Embed Badge

![Health badge](/badges/kdaviesnz-square/health.svg)

```
[![Health](https://phpackages.com/badges/kdaviesnz-square/health.svg)](https://phpackages.com/packages/kdaviesnz-square)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
