Skip to content

Commit

Permalink
Generated PR for Release: 19.0.0.20220512
Browse files Browse the repository at this point in the history
  • Loading branch information
autobot committed May 12, 2022
1 parent e41e5cc commit 3ad82d2
Show file tree
Hide file tree
Showing 813 changed files with 18,005 additions and 5,140 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve Square SDKs
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**Expected behavior**
A clear and concise description of what you expected to happen.

**To Reproduce**
Steps to reproduce the bug:
1. (step 1)
2. (step 2)
3. (step 3)
4. ...

**Screenshots**
If applicable, add screenshots to help explain the bug.

**Square SDK version**
For example: 17.2.x

**Additional context**
Add any other context about the problem here.
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Contributing to Square SDKs

Thank you for your willingness to help improve the Square SDKs. Your feedback and expertise ultimately benefits everyone who builds with Square.

If you encounter a bug while using Square SDKs, please [let us know](#bug-reporting). We'll investigate the issue and fix it as soon as possible.

We also accept feedback in the form of a pull request (PR), and will follow up with you if we need more information. However, any code changes required will be perfomed by Square engineering, and we'll close the PR.

## Bug report

To report a bug:
* Go to the **[Issues](../../issues)** page.
* Click **New issue**.
* Click **Get started**.

## Other support

For all other support, including new feature requests, see:

* Square developer forums: [https://developer.squareup.com/forums](https://developer.squareup.com/forums)
* Square support center: [https://squareup.com/help/us/en](https://squareup.com/help/us/en)
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,30 +33,35 @@ cd square-php-sdk
```

Next, make sure you've downloaded Composer, following the instructions [here](https://getcomposer.org/download/)
and then run the following command from the directory containing `composer.json`:
and then run the following command from the root of the repository:

```
```sh
composer install
```


Before running the tests, find a sandbox token in your [Developer Dashboard] and set a `SQUARE_ACCESS_TOKEN` environment variable.
Before running the tests, find a sandbox token in your [Developer Dashboard] and set environment variables:

```sh
$dotenv = Dotenv::create(__DIR__);
$dotenv->load();
$timeout = getenv('SQUARE_TIMEOUT');
$accessToken = getenv('SQUARE_ACCESS_TOKEN');
$environment = getenv('SQUARE_ENVIRONMENT');
$baseUrl = getenv('SQUARE_BASE_URL');
export SQUARE_ACCESS_TOKEN=mytoken
export SQUARE_ENVIRONMENT=sandbox
```

And run the tests.
Run the tests:

```sh
php composer.phar run test
composer run test
```

All environment variables:
* `SQUARE_TIMEOUT` - number
* `SQUARE_NUMBER_OF_RETRIES` - number
* `SQUARE_MAXIMUM_RETRY_WAIT_TIME` - number
* `SQUARE_SQUARE_VERSION` - string
* `SQUARE_USER_AGENT_DETAIL` - string
* `SQUARE_CUSTOM_URL` - string
* `SQUARE_ACCESS_TOKEN` - string
* `SQUARE_ENVIRONMENT` - string - one of production, sandbox, custom

## SDK Reference

### Payments
Expand Down Expand Up @@ -86,6 +91,7 @@ php composer.phar run test

### Customers
* [Customers]
* [Customer Custom Attributes]
* [Customer Groups]
* [Customer Segments]

Expand All @@ -104,6 +110,7 @@ php composer.phar run test
* [Locations]
* [Devices]
* [Cash Drawers]
* [Vendors]

### Team
* [Team]
Expand Down Expand Up @@ -137,7 +144,9 @@ php composer.phar run test
[Disputes]: doc/apis/disputes.md
[Terminal]: doc/apis/terminal.md
[Cash Drawers]: doc/apis/cash-drawers.md
[Vendors]: doc/apis/vendors.md
[Customer Groups]: doc/apis/customer-groups.md
[Customer Custom Attributes]: doc/apis/customer-custom-attributes.md
[Customer Segments]: doc/apis/customer-segments.md
[Bank Accounts]: doc/apis/bank-accounts.md
[Payments]: doc/apis/payments.md
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "square/square",
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
"version": "18.0.0.20220420",
"version": "19.0.0.20220512",
"type": "library",
"keywords": [
"Square",
Expand Down
6 changes: 1 addition & 5 deletions doc/apis/bank-accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ function listBankAccounts(?string $cursor = null, ?int $limit = null, ?string $l
## Example Usage

```php
$cursor = 'cursor6';
$limit = 172;
$locationId = 'location_id4';

$apiResponse = $bankAccountsApi->listBankAccounts($cursor, $limit, $locationId);
$apiResponse = $bankAccountsApi->listBankAccounts();

if ($apiResponse->isSuccess()) {
$listBankAccountsResponse = $apiResponse->getResult();
Expand Down
62 changes: 11 additions & 51 deletions doc/apis/bookings.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,7 @@ function listBookings(
## Example Usage

```php
$limit = 172;
$cursor = 'cursor6';
$teamMemberId = 'team_member_id0';
$locationId = 'location_id4';
$startAtMin = 'start_at_min8';
$startAtMax = 'start_at_max8';

$apiResponse = $bookingsApi->listBookings($limit, $cursor, $teamMemberId, $locationId, $startAtMin, $startAtMax);
$apiResponse = $bookingsApi->listBookings();

if ($apiResponse->isSuccess()) {
$listBookingsResponse = $apiResponse->getResult();
Expand All @@ -85,6 +78,9 @@ Creates a booking.
To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.

For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*
or *Appointments Premium*.

```php
function createBooking(CreateBookingRequest $body): ApiResponse
```
Expand All @@ -103,15 +99,9 @@ function createBooking(CreateBookingRequest $body): ApiResponse

```php
$body_booking = new Models\Booking;
$body_booking->setId('id8');
$body_booking->setVersion(148);
$body_booking->setStatus(Models\BookingStatus::ACCEPTED);
$body_booking->setCreatedAt('created_at6');
$body_booking->setUpdatedAt('updated_at4');
$body = new Models\CreateBookingRequest(
$body_booking
);
$body->setIdempotencyKey('idempotency_key2');

$apiResponse = $bookingsApi->createBooking($body);

Expand Down Expand Up @@ -152,34 +142,9 @@ function searchAvailability(SearchAvailabilityRequest $body): ApiResponse

```php
$body_query_filter_startAtRange = new Models\TimeRange;
$body_query_filter_startAtRange->setStartAt('start_at8');
$body_query_filter_startAtRange->setEndAt('end_at4');
$body_query_filter = new Models\SearchAvailabilityFilter(
$body_query_filter_startAtRange
);
$body_query_filter->setLocationId('location_id6');
$body_query_filter_segmentFilters = [];

$body_query_filter_segmentFilters_0_serviceVariationId = 'service_variation_id8';
$body_query_filter_segmentFilters[0] = new Models\SegmentFilter(
$body_query_filter_segmentFilters_0_serviceVariationId
);
$body_query_filter_segmentFilters[0]->setTeamMemberIdFilter(new Models\FilterValue);
$body_query_filter_segmentFilters[0]->getTeamMemberIdFilter()->setAll(['all7']);
$body_query_filter_segmentFilters[0]->getTeamMemberIdFilter()->setAny(['any0', 'any1']);
$body_query_filter_segmentFilters[0]->getTeamMemberIdFilter()->setNone(['none5']);

$body_query_filter_segmentFilters_1_serviceVariationId = 'service_variation_id7';
$body_query_filter_segmentFilters[1] = new Models\SegmentFilter(
$body_query_filter_segmentFilters_1_serviceVariationId
);
$body_query_filter_segmentFilters[1]->setTeamMemberIdFilter(new Models\FilterValue);
$body_query_filter_segmentFilters[1]->getTeamMemberIdFilter()->setAll(['all6', 'all7', 'all8']);
$body_query_filter_segmentFilters[1]->getTeamMemberIdFilter()->setAny(['any1', 'any2', 'any3']);
$body_query_filter_segmentFilters[1]->getTeamMemberIdFilter()->setNone(['none6', 'none7']);
$body_query_filter->setSegmentFilters($body_query_filter_segmentFilters);

$body_query_filter->setBookingId('booking_id6');
$body_query = new Models\SearchAvailabilityQuery(
$body_query_filter
);
Expand Down Expand Up @@ -260,11 +225,8 @@ function listTeamMemberBookingProfiles(

```php
$bookableOnly = false;
$limit = 172;
$cursor = 'cursor6';
$locationId = 'location_id4';

$apiResponse = $bookingsApi->listTeamMemberBookingProfiles($bookableOnly, $limit, $cursor, $locationId);
$apiResponse = $bookingsApi->listTeamMemberBookingProfiles($bookableOnly);

if ($apiResponse->isSuccess()) {
$listTeamMemberBookingProfilesResponse = $apiResponse->getResult();
Expand Down Expand Up @@ -362,6 +324,9 @@ Updates a booking.
To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.

For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*
or *Appointments Premium*.

```php
function updateBooking(string $bookingId, UpdateBookingRequest $body): ApiResponse
```
Expand All @@ -382,15 +347,9 @@ function updateBooking(string $bookingId, UpdateBookingRequest $body): ApiRespon
```php
$bookingId = 'booking_id4';
$body_booking = new Models\Booking;
$body_booking->setId('id8');
$body_booking->setVersion(148);
$body_booking->setStatus(Models\BookingStatus::ACCEPTED);
$body_booking->setCreatedAt('created_at6');
$body_booking->setUpdatedAt('updated_at4');
$body = new Models\UpdateBookingRequest(
$body_booking
);
$body->setIdempotencyKey('idempotency_key2');

$apiResponse = $bookingsApi->updateBooking($bookingId, $body);

Expand All @@ -413,6 +372,9 @@ Cancels an existing booking.
To call this endpoint with buyer-level permissions, set `APPOINTMENTS_WRITE` for the OAuth scope.
To call this endpoint with seller-level permissions, set `APPOINTMENTS_ALL_WRITE` and `APPOINTMENTS_WRITE` for the OAuth scope.

For calls to this endpoint with seller-level permissions to succeed, the seller must have subscribed to *Appointments Plus*
or *Appointments Premium*.

```php
function cancelBooking(string $bookingId, CancelBookingRequest $body): ApiResponse
```
Expand All @@ -433,8 +395,6 @@ function cancelBooking(string $bookingId, CancelBookingRequest $body): ApiRespon
```php
$bookingId = 'booking_id4';
$body = new Models\CancelBookingRequest;
$body->setIdempotencyKey('idempotency_key2');
$body->setBookingVersion(8);

$apiResponse = $bookingsApi->cancelBooking($bookingId, $body);

Expand Down
14 changes: 1 addition & 13 deletions doc/apis/cards.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,9 @@ function listCards(
## Example Usage

```php
$cursor = 'cursor6';
$customerId = 'customer_id8';
$includeDisabled = false;
$referenceId = 'reference_id2';
$sortOrder = Models\SortOrder::DESC;

$apiResponse = $cardsApi->listCards($cursor, $customerId, $includeDisabled, $referenceId, $sortOrder);
$apiResponse = $cardsApi->listCards(null, null, $includeDisabled);

if ($apiResponse->isSuccess()) {
$listCardsResponse = $apiResponse->getResult();
Expand Down Expand Up @@ -92,18 +88,11 @@ function createCard(CreateCardRequest $body): ApiResponse
$body_idempotencyKey = '4935a656-a929-4792-b97c-8848be85c27c';
$body_sourceId = 'cnon:uIbfJXhXETSP197M3GB';
$body_card = new Models\Card;
$body_card->setId('id0');
$body_card->setCardBrand(Models\CardBrand::INTERAC);
$body_card->setLast4('last_42');
$body_card->setExpMonth(236);
$body_card->setExpYear(60);
$body_card->setCardholderName('Amelia Earhart');
$body_card->setBillingAddress(new Models\Address);
$body_card->getBillingAddress()->setAddressLine1('500 Electric Ave');
$body_card->getBillingAddress()->setAddressLine2('Suite 600');
$body_card->getBillingAddress()->setAddressLine3('address_line_34');
$body_card->getBillingAddress()->setLocality('New York');
$body_card->getBillingAddress()->setSublocality('sublocality8');
$body_card->getBillingAddress()->setAdministrativeDistrictLevel1('NY');
$body_card->getBillingAddress()->setPostalCode('10003');
$body_card->getBillingAddress()->setCountry(Models\Country::US);
Expand All @@ -114,7 +103,6 @@ $body = new Models\CreateCardRequest(
$body_sourceId,
$body_card
);
$body->setVerificationToken('verification_token0');

$apiResponse = $cardsApi->createCard($body);

Expand Down
11 changes: 2 additions & 9 deletions doc/apis/cash-drawers.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,8 @@ function listCashDrawerShifts(

```php
$locationId = 'location_id4';
$sortOrder = Models\SortOrder::DESC;
$beginTime = 'begin_time2';
$endTime = 'end_time2';
$limit = 172;
$cursor = 'cursor6';

$apiResponse = $cashDrawersApi->listCashDrawerShifts($locationId, $sortOrder, $beginTime, $endTime, $limit, $cursor);
$apiResponse = $cashDrawersApi->listCashDrawerShifts($locationId);

if ($apiResponse->isSuccess()) {
$listCashDrawerShiftsResponse = $apiResponse->getResult();
Expand Down Expand Up @@ -141,10 +136,8 @@ function listCashDrawerShiftEvents(
```php
$locationId = 'location_id4';
$shiftId = 'shift_id0';
$limit = 172;
$cursor = 'cursor6';

$apiResponse = $cashDrawersApi->listCashDrawerShiftEvents($locationId, $shiftId, $limit, $cursor);
$apiResponse = $cashDrawersApi->listCashDrawerShiftEvents($locationId, $shiftId);

if ($apiResponse->isSuccess()) {
$listCashDrawerShiftEventsResponse = $apiResponse->getResult();
Expand Down
Loading

0 comments on commit 3ad82d2

Please sign in to comment.