Skip to content

Commit

Permalink
Merge pull request #92 from square/release/21.0.0.20220817
Browse files Browse the repository at this point in the history
Generated PR for Release: 21.0.0.20220817
  • Loading branch information
daphnechiu authored Aug 16, 2022
2 parents 9a2bf04 + 88efd0e commit 1e54ffa
Show file tree
Hide file tree
Showing 328 changed files with 8,852 additions and 1,356 deletions.
9 changes: 7 additions & 2 deletions 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": "20.1.0.20220720",
"version": "21.0.0.20220817",
"type": "library",
"keywords": [
"Square",
Expand All @@ -22,7 +22,7 @@
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"apimatic/unirest-php": "^2.3.0",
"apimatic/unirest-php": "^3.0.1",
"apimatic/jsonmapper": "^3.0.4"
},
"require-dev": {
Expand All @@ -35,6 +35,11 @@
"Square\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Square\\Tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit",
"test-coverage": "phpunit --coverage-html=coverage",
Expand Down
4 changes: 4 additions & 0 deletions doc/apis/checkout.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ $checkoutApi = $client->getCheckoutApi();

# Create Checkout

**This endpoint is deprecated.**

Links a `checkoutId` to a `checkout_page_url` that customers are
directed to in order to provide their payment information using a
payment processing workflow hosted on connect.squareup.com.
Expand Down Expand Up @@ -137,6 +139,8 @@ $body->getPrePopulateShippingAddress()->setLocality('San Francisco');
$body->getPrePopulateShippingAddress()->setAdministrativeDistrictLevel1('CA');
$body->getPrePopulateShippingAddress()->setPostalCode('94103');
$body->getPrePopulateShippingAddress()->setCountry(Models\Country::US);
$body->getPrePopulateShippingAddress()->setFirstName('Jane');
$body->getPrePopulateShippingAddress()->setLastName('Doe');
$body->setRedirectUrl('https://merchant.website.com/order-confirm');
$body_additionalRecipients = [];

Expand Down
40 changes: 23 additions & 17 deletions doc/apis/customer-custom-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ $customerCustomAttributesApi = $client->getCustomerCustomAttributesApi();

# List Customer Custom Attribute Definitions

Lists the customer-related custom attribute definitions that belong to a Square seller account.
Lists the customer-related [custom attribute definitions](../../doc/models/custom-attribute-definition.md) that belong to a Square seller account.

When all response pages are retrieved, the results include all custom attribute definitions
that are visible to the requesting application, including those that are created by other
applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
applications and set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that
seller-defined custom attributes (also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.

```php
function listCustomerCustomAttributeDefinitions(?int $limit = null, ?string $cursor = null): ApiResponse
Expand Down Expand Up @@ -64,8 +65,8 @@ if ($apiResponse->isSuccess()) {

# Create Customer Custom Attribute Definition

Creates a customer-related custom attribute definition for a Square seller account. Use this
endpoint to define a custom attribute that can be associated with customer profiles.
Creates a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) for a Square seller account.
Use this endpoint to define a custom attribute that can be associated with customer profiles.

A custom attribute definition specifies the `key`, `visibility`, `schema`, and other properties
for a custom attribute. After the definition is created, you can call
Expand Down Expand Up @@ -120,7 +121,7 @@ if ($apiResponse->isSuccess()) {

# Delete Customer Custom Attribute Definition

Deletes a customer-related custom attribute definition from a Square seller account.
Deletes a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account.

Deleting a custom attribute definition also deletes the corresponding custom attribute from
all customer profiles in the seller's Customer Directory.
Expand Down Expand Up @@ -162,10 +163,11 @@ if ($apiResponse->isSuccess()) {

# Retrieve Customer Custom Attribute Definition

Retrieves a customer-related custom attribute definition from a Square seller account.
Retrieves a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account.

To retrieve a custom attribute definition created by another application, the `visibility`
setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
setting must be `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes
(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.

```php
function retrieveCustomerCustomAttributeDefinition(string $key, ?int $version = null): ApiResponse
Expand Down Expand Up @@ -203,7 +205,7 @@ if ($apiResponse->isSuccess()) {

# Update Customer Custom Attribute Definition

Updates a customer-related custom attribute definition for a Square seller account.
Updates a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) for a Square seller account.

Use this endpoint to update the following fields: `name`, `description`, `visibility`, or the
`schema` for a `Selection` data type.
Expand Down Expand Up @@ -256,7 +258,7 @@ if ($apiResponse->isSuccess()) {

# Bulk Upsert Customer Custom Attributes

Creates or updates custom attributes for customer profiles as a bulk operation.
Creates or updates [custom attributes](../../doc/models/custom-attribute.md) for customer profiles as a bulk operation.

Use this endpoint to set the value of one or more custom attributes for one or more customer profiles.
A custom attribute is based on a custom attribute definition in a Square seller account, which is
Expand All @@ -268,7 +270,8 @@ and provides a customer ID and custom attribute. Each upsert response is returne
of the corresponding request.

To create or update a custom attribute owned by another application, the `visibility` setting
must be `VISIBILITY_READ_WRITE_VALUES`.
must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes
(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.

```php
function bulkUpsertCustomerCustomAttributes(BulkUpsertCustomerCustomAttributesRequest $body): ApiResponse
Expand Down Expand Up @@ -344,7 +347,7 @@ if ($apiResponse->isSuccess()) {

# List Customer Custom Attributes

Lists the custom attributes associated with a customer profile.
Lists the [custom attributes](../../doc/models/custom-attribute.md) associated with a customer profile.

You can use the `with_definitions` query parameter to also retrieve custom attribute definitions
in the same call.
Expand Down Expand Up @@ -397,10 +400,11 @@ if ($apiResponse->isSuccess()) {

# Delete Customer Custom Attribute

Deletes a custom attribute associated with a customer profile.
Deletes a [custom attribute](../../doc/models/custom-attribute.md) associated with a customer profile.

To delete a custom attribute owned by another application, the `visibility` setting must be
`VISIBILITY_READ_WRITE_VALUES`.
`VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes
(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.

```php
function deleteCustomerCustomAttribute(string $customerId, string $key): ApiResponse
Expand Down Expand Up @@ -439,13 +443,14 @@ if ($apiResponse->isSuccess()) {

# Retrieve Customer Custom Attribute

Retrieves a custom attribute associated with a customer profile.
Retrieves a [custom attribute](../../doc/models/custom-attribute.md) associated with a customer profile.

You can use the `with_definition` query parameter to also retrieve the custom attribute definition
in the same call.

To retrieve a custom attribute owned by another application, the `visibility` setting must be
`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`.
`VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes
(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.

```php
function retrieveCustomerCustomAttribute(
Expand Down Expand Up @@ -492,14 +497,15 @@ if ($apiResponse->isSuccess()) {

# Upsert Customer Custom Attribute

Creates or updates a custom attribute for a customer profile.
Creates or updates a [custom attribute](../../doc/models/custom-attribute.md) for a customer profile.

Use this endpoint to set the value of a custom attribute for a specified customer profile.
A custom attribute is based on a custom attribute definition in a Square seller account, which
is created using the [CreateCustomerCustomAttributeDefinition](../../doc/apis/customer-custom-attributes.md#create-customer-custom-attribute-definition) endpoint.

To create or update a custom attribute owned by another application, the `visibility` setting
must be `VISIBILITY_READ_WRITE_VALUES`.
must be `VISIBILITY_READ_WRITE_VALUES`. Note that seller-defined custom attributes
(also known as custom fields) are always set to `VISIBILITY_READ_WRITE_VALUES`.

```php
function upsertCustomerCustomAttribute(
Expand Down
2 changes: 1 addition & 1 deletion doc/apis/customers.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ if ($apiResponse->isSuccess()) {

# Search Customers

Searches the customer profiles associated with a Square account using a supported query filter.
Searches the customer profiles associated with a Square account using one or more supported query filters.

Calling `SearchCustomers` without any explicit query filter returns all
customer profiles ordered alphabetically based on `given_name` and
Expand Down
30 changes: 14 additions & 16 deletions doc/apis/disputes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ function listDisputes(?string $cursor = null, ?string $states = null, ?string $l
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). |
| `states` | [`?string (DisputeState)`](../../doc/models/dispute-state.md) | Query, Optional | The dispute states to filter the result.<br>If not specified, the endpoint returns all open disputes (the dispute status is not `INQUIRY_CLOSED`, `WON`,<br>or `LOST`). |
| `locationId` | `?string` | Query, Optional | The ID of the location for which to return a list of disputes. If not specified, the endpoint returns<br>all open disputes (the dispute status is not `INQUIRY_CLOSED`, `WON`, or `LOST`) associated with all locations. |
| `states` | [`?string (DisputeState)`](../../doc/models/dispute-state.md) | Query, Optional | The dispute states used to filter the result. If not specified, the endpoint returns all disputes. |
| `locationId` | `?string` | Query, Optional | The ID of the location for which to return a list of disputes.<br>If not specified, the endpoint returns disputes associated with all locations. |

## Response Type

Expand Down Expand Up @@ -149,7 +149,7 @@ function listDisputeEvidence(string $disputeId, ?string $cursor = null): ApiResp
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `disputeId` | `string` | Template, Required | The ID of the dispute. |
| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). |
| `cursor` | `?string` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br>For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |

## Response Type

Expand Down Expand Up @@ -191,7 +191,7 @@ function createDisputeEvidenceFile(

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `disputeId` | `string` | Template, Required | The ID of the dispute you want to upload evidence for. |
| `disputeId` | `string` | Template, Required | The ID of the dispute for which you want to upload evidence. |
| `request` | [`?CreateDisputeEvidenceFileRequest`](../../doc/models/create-dispute-evidence-file-request.md) | Form (JSON-Encoded), Optional | Defines the parameters for a `CreateDisputeEvidenceFile` request. |
| `imageFile` | `?FileWrapper` | Form, Optional | - |

Expand Down Expand Up @@ -230,7 +230,7 @@ function createDisputeEvidenceText(string $disputeId, CreateDisputeEvidenceTextR

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `disputeId` | `string` | Template, Required | The ID of the dispute you want to upload evidence for. |
| `disputeId` | `string` | Template, Required | The ID of the dispute for which you want to upload evidence. |
| `body` | [`CreateDisputeEvidenceTextRequest`](../../doc/models/create-dispute-evidence-text-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |

## Response Type
Expand Down Expand Up @@ -266,9 +266,7 @@ if ($apiResponse->isSuccess()) {
# Delete Dispute Evidence

Removes specified evidence from a dispute.

Square does not send the bank any evidence that is removed. Also, you cannot remove evidence after
submitting it to the bank using [SubmitEvidence](../../doc/apis/disputes.md#submit-evidence).
Square does not send the bank any evidence that is removed.

```php
function deleteDisputeEvidence(string $disputeId, string $evidenceId): ApiResponse
Expand All @@ -278,7 +276,7 @@ function deleteDisputeEvidence(string $disputeId, string $evidenceId): ApiRespon

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `disputeId` | `string` | Template, Required | The ID of the dispute you want to remove evidence from. |
| `disputeId` | `string` | Template, Required | The ID of the dispute from which you want to remove evidence. |
| `evidenceId` | `string` | Template, Required | The ID of the evidence you want to remove. |

## Response Type
Expand Down Expand Up @@ -307,10 +305,9 @@ if ($apiResponse->isSuccess()) {

# Retrieve Dispute Evidence

Returns the evidence metadata specified by the evidence ID in the request URL path
Returns the metadata for the evidence specified in the request URL path.

You must maintain a copy of the evidence you upload if you want to reference it later. You cannot
download the evidence after you upload it.
You must maintain a copy of any evidence uploaded if you want to reference it later. Evidence cannot be downloaded after you upload it.

```php
function retrieveDisputeEvidence(string $disputeId, string $evidenceId): ApiResponse
Expand All @@ -320,7 +317,7 @@ function retrieveDisputeEvidence(string $disputeId, string $evidenceId): ApiResp

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `disputeId` | `string` | Template, Required | The ID of the dispute that you want to retrieve evidence from. |
| `disputeId` | `string` | Template, Required | The ID of the dispute from which you want to retrieve evidence metadata. |
| `evidenceId` | `string` | Template, Required | The ID of the evidence to retrieve. |

## Response Type
Expand Down Expand Up @@ -351,10 +348,11 @@ if ($apiResponse->isSuccess()) {

Submits evidence to the cardholder's bank.

Before submitting evidence, Square compiles all available evidence. This includes evidence uploaded
The evidence submitted by this endpoint includes evidence uploaded
using the [CreateDisputeEvidenceFile](../../doc/apis/disputes.md#create-dispute-evidence-file) and
[CreateDisputeEvidenceText](../../doc/apis/disputes.md#create-dispute-evidence-text) endpoints and
evidence automatically provided by Square, when available.
evidence automatically provided by Square, when available. Evidence cannot be removed from
a dispute after submission.

```php
function submitEvidence(string $disputeId): ApiResponse
Expand All @@ -364,7 +362,7 @@ function submitEvidence(string $disputeId): ApiResponse

| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| `disputeId` | `string` | Template, Required | The ID of the dispute that you want to submit evidence for. |
| `disputeId` | `string` | Template, Required | The ID of the dispute for which you want to submit evidence. |

## Response Type

Expand Down
1 change: 1 addition & 0 deletions doc/apis/invoices.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ function updateInvoice(string $invoiceId, UpdateInvoiceRequest $body): ApiRespon
```php
$invoiceId = 'invoice_id0';
$body_invoice = new Models\Invoice;
$body_invoice->setVersion(1);
$body_invoice_paymentRequests = [];

$body_invoice_paymentRequests[0] = new Models\InvoicePaymentRequest;
Expand Down
Loading

0 comments on commit 1e54ffa

Please sign in to comment.