Skip to content

Commit eff2315

Browse files
author
Xiao Hu
authored
Merge pull request #93 from square/release/21.1.0.20220823
Generated PR for Release: 21.1.0.20220823
2 parents 1e54ffa + 63ac88f commit eff2315

File tree

9 files changed

+124
-11
lines changed

9 files changed

+124
-11
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "square/square",
33
"description": "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.",
4-
"version": "21.0.0.20220817",
4+
"version": "21.1.0.20220823",
55
"type": "library",
66
"keywords": [
77
"Square",

doc/client.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:
55

66
| Parameter | Type | Description |
77
| --- | --- | --- |
8-
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-08-17'` |
8+
| `squareVersion` | `string` | Square Connect API versions<br>*Default*: `'2022-08-23'` |
99
| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
1010
| `environment` | `string` | The API environment. <br> **Default: `production`** |
1111
| `timeout` | `int` | Timeout for API calls in seconds.<br>*Default*: `60` |
@@ -27,7 +27,7 @@ The API client can be initialized as follows:
2727
$client = new Square\SquareClient([
2828
// Set authentication parameters
2929
'accessToken' => 'AccessToken',
30-
'squareVersion' => '2022-08-17',
30+
'squareVersion' => '2022-08-23',
3131

3232
// Set the environment
3333
'environment' => 'production',
@@ -54,7 +54,7 @@ require_once "vendor/autoload.php";
5454

5555
$client = new Square\SquareClient([
5656
'accessToken' => 'AccessToken',
57-
'squareVersion' => '2022-08-17',
57+
'squareVersion' => '2022-08-23',
5858
]);
5959

6060
$locationsApi = $client->getLocationsApi();

doc/models/buy-now-pay-later-details.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ Additional details about a Buy Now Pay Later payment type.
1111

1212
| Name | Type | Tags | Description | Getter | Setter |
1313
| --- | --- | --- | --- | --- | --- |
14-
| `brand` | `?string` | Optional | The brand used for the Buy Now Pay Later payment.<br>The brand can be `AFTERPAY` or `UNKNOWN`.<br>**Constraints**: *Maximum Length*: `50` | getBrand(): ?string | setBrand(?string brand): void |
14+
| `brand` | `?string` | Optional | The brand used for the Buy Now Pay Later payment.<br>The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.<br>**Constraints**: *Maximum Length*: `50` | getBrand(): ?string | setBrand(?string brand): void |
1515
| `afterpayDetails` | [`?AfterpayDetails`](../../doc/models/afterpay-details.md) | Optional | Additional details about Afterpay payments. | getAfterpayDetails(): ?AfterpayDetails | setAfterpayDetails(?AfterpayDetails afterpayDetails): void |
16+
| `clearpayDetails` | [`?ClearpayDetails`](../../doc/models/clearpay-details.md) | Optional | Additional details about Clearpay payments. | getClearpayDetails(): ?ClearpayDetails | setClearpayDetails(?ClearpayDetails clearpayDetails): void |
1617

1718
## Example (as JSON)
1819

1920
```json
2021
{
2122
"brand": null,
22-
"afterpay_details": null
23+
"afterpay_details": null,
24+
"clearpay_details": null
2325
}
2426
```
2527

doc/models/clearpay-details.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
# Clearpay Details
3+
4+
Additional details about Clearpay payments.
5+
6+
## Structure
7+
8+
`ClearpayDetails`
9+
10+
## Fields
11+
12+
| Name | Type | Tags | Description | Getter | Setter |
13+
| --- | --- | --- | --- | --- | --- |
14+
| `emailAddress` | `?string` | Optional | Email address on the buyer's Clearpay account.<br>**Constraints**: *Maximum Length*: `255` | getEmailAddress(): ?string | setEmailAddress(?string emailAddress): void |
15+
16+
## Example (as JSON)
17+
18+
```json
19+
{
20+
"email_address": null
21+
}
22+
```
23+

src/Apis/BaseApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class BaseApi
5151
*/
5252
protected $internalUserAgent;
5353

54-
private static $userAgent = 'Square-PHP-SDK/21.0.0.20220817 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}';
54+
private static $userAgent = 'Square-PHP-SDK/21.1.0.20220823 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}';
5555

5656
/**
5757
* Constructor that sets the timeout of requests

src/ConfigurationDefaults.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ConfigurationDefaults
2727

2828
public const HTTP_METHODS_TO_RETRY = ['GET', 'PUT'];
2929

30-
public const SQUARE_VERSION = '2022-08-17';
30+
public const SQUARE_VERSION = '2022-08-23';
3131

3232
public const ADDITIONAL_HEADERS = [];
3333

src/Models/BuyNowPayLaterDetails.php

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ class BuyNowPayLaterDetails implements \JsonSerializable
2121
*/
2222
private $afterpayDetails;
2323

24+
/**
25+
* @var ClearpayDetails|null
26+
*/
27+
private $clearpayDetails;
28+
2429
/**
2530
* Returns Brand.
2631
* The brand used for the Buy Now Pay Later payment.
27-
* The brand can be `AFTERPAY` or `UNKNOWN`.
32+
* The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.
2833
*/
2934
public function getBrand(): ?string
3035
{
@@ -34,7 +39,7 @@ public function getBrand(): ?string
3439
/**
3540
* Sets Brand.
3641
* The brand used for the Buy Now Pay Later payment.
37-
* The brand can be `AFTERPAY` or `UNKNOWN`.
42+
* The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.
3843
*
3944
* @maps brand
4045
*/
@@ -63,6 +68,26 @@ public function setAfterpayDetails(?AfterpayDetails $afterpayDetails): void
6368
$this->afterpayDetails = $afterpayDetails;
6469
}
6570

71+
/**
72+
* Returns Clearpay Details.
73+
* Additional details about Clearpay payments.
74+
*/
75+
public function getClearpayDetails(): ?ClearpayDetails
76+
{
77+
return $this->clearpayDetails;
78+
}
79+
80+
/**
81+
* Sets Clearpay Details.
82+
* Additional details about Clearpay payments.
83+
*
84+
* @maps clearpay_details
85+
*/
86+
public function setClearpayDetails(?ClearpayDetails $clearpayDetails): void
87+
{
88+
$this->clearpayDetails = $clearpayDetails;
89+
}
90+
6691
/**
6792
* Encode this object to JSON
6893
*
@@ -81,6 +106,9 @@ public function jsonSerialize(bool $asArrayWhenEmpty = false)
81106
if (isset($this->afterpayDetails)) {
82107
$json['afterpay_details'] = $this->afterpayDetails;
83108
}
109+
if (isset($this->clearpayDetails)) {
110+
$json['clearpay_details'] = $this->clearpayDetails;
111+
}
84112
$json = array_filter($json, function ($val) {
85113
return $val !== null;
86114
});

src/Models/ClearpayDetails.php

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Square\Models;
6+
7+
use stdClass;
8+
9+
/**
10+
* Additional details about Clearpay payments.
11+
*/
12+
class ClearpayDetails implements \JsonSerializable
13+
{
14+
/**
15+
* @var string|null
16+
*/
17+
private $emailAddress;
18+
19+
/**
20+
* Returns Email Address.
21+
* Email address on the buyer's Clearpay account.
22+
*/
23+
public function getEmailAddress(): ?string
24+
{
25+
return $this->emailAddress;
26+
}
27+
28+
/**
29+
* Sets Email Address.
30+
* Email address on the buyer's Clearpay account.
31+
*
32+
* @maps email_address
33+
*/
34+
public function setEmailAddress(?string $emailAddress): void
35+
{
36+
$this->emailAddress = $emailAddress;
37+
}
38+
39+
/**
40+
* Encode this object to JSON
41+
*
42+
* @param bool $asArrayWhenEmpty Whether to serialize this model as an array whenever no fields
43+
* are set. (default: false)
44+
*
45+
* @return array|stdClass
46+
*/
47+
#[\ReturnTypeWillChange] // @phan-suppress-current-line PhanUndeclaredClassAttribute for (php < 8.1)
48+
public function jsonSerialize(bool $asArrayWhenEmpty = false)
49+
{
50+
$json = [];
51+
if (isset($this->emailAddress)) {
52+
$json['email_address'] = $this->emailAddress;
53+
}
54+
$json = array_filter($json, function ($val) {
55+
return $val !== null;
56+
});
57+
58+
return (!$asArrayWhenEmpty && empty($json)) ? new stdClass() : $json;
59+
}
60+
}

src/SquareClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public function getBearerAuthCredentials(): ?BearerAuthCredentials
272272
*/
273273
public function getSdkVersion(): string
274274
{
275-
return '21.0.0.20220817';
275+
return '21.1.0.20220823';
276276
}
277277

278278
/**

0 commit comments

Comments
 (0)