Skip to content

Commit 68fe997

Browse files
author
Xiao Hu
authored
Merge pull request #85 from square/release/23.1.0.20220823
Generated PR for Release: 23.1.0.20220823
2 parents ddf16d4 + f0c27ff commit 68fe997

File tree

9 files changed

+171
-17
lines changed

9 files changed

+171
-17
lines changed

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
| `httpClientConfig` | `ReadonlyHttpClientConfiguration` | Http Client Configuration instance. |
@@ -19,7 +19,7 @@ The API client can be initialized as follows:
1919
SquareClient client = new SquareClient.Builder()
2020
.httpClientConfig(configBuilder -> configBuilder
2121
.timeout(0))
22-
.squareVersion("2022-08-17")
22+
.squareVersion("2022-08-23")
2323
.accessToken("AccessToken")
2424
.environment(Environment.PRODUCTION)
2525
.customUrl("https://connect.squareup.com")
@@ -45,7 +45,7 @@ public class Program {
4545
SquareClient client = new SquareClient.Builder()
4646
.httpClientConfig(configBuilder -> configBuilder
4747
.timeout(0))
48-
.squareVersion("2022-08-17")
48+
.squareVersion("2022-08-23")
4949
.accessToken("AccessToken")
5050
.build();
5151

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 |
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` | String getBrand() |
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` | String getBrand() |
1515
| `AfterpayDetails` | [`AfterpayDetails`](../../doc/models/afterpay-details.md) | Optional | Additional details about Afterpay payments. | AfterpayDetails getAfterpayDetails() |
16+
| `ClearpayDetails` | [`ClearpayDetails`](../../doc/models/clearpay-details.md) | Optional | Additional details about Clearpay payments. | ClearpayDetails getClearpayDetails() |
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 |
13+
| --- | --- | --- | --- | --- |
14+
| `EmailAddress` | `String` | Optional | Email address on the buyer's Clearpay account.<br>**Constraints**: *Maximum Length*: `255` | String getEmailAddress() |
15+
16+
## Example (as JSON)
17+
18+
```json
19+
{
20+
"email_address": null
21+
}
22+
```
23+

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>com.squareup</groupId>
66
<artifactId>square</artifactId>
7-
<version>23.0.0.20220817</version>
7+
<version>23.1.0.20220823</version>
88
<packaging>jar</packaging>
99

1010
<name>Square</name>

src/main/java/com/squareup/square/SquareClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ public String getAccessToken() {
658658
* @return sdkVersion
659659
*/
660660
public String getSdkVersion() {
661-
return "23.0.0.20220817";
661+
return "23.1.0.20220823";
662662
}
663663

664664
/**
@@ -760,7 +760,7 @@ public static class Builder {
760760

761761
private Environment environment = Environment.PRODUCTION;
762762
private String customUrl = "https://connect.squareup.com";
763-
private String squareVersion = "2022-08-17";
763+
private String squareVersion = "2022-08-23";
764764
private HttpClient httpClient;
765765
private Headers additionalHeaders = new Headers();
766766
private String userAgentDetail = null;

src/main/java/com/squareup/square/api/BaseApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public abstract class BaseApi {
2222

2323
protected String internalUserAgent;
2424

25-
private static String userAgent = "Square-Java-SDK/23.0.0.20220817 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}";
25+
private static String userAgent = "Square-Java-SDK/23.1.0.20220823 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}";
2626

2727
/**
2828
* Protected variables to hold an instance of Configuration.

src/main/java/com/squareup/square/models/BuyNowPayLaterDetails.java

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,28 @@
1313
public class BuyNowPayLaterDetails {
1414
private final String brand;
1515
private final AfterpayDetails afterpayDetails;
16+
private final ClearpayDetails clearpayDetails;
1617

1718
/**
1819
* Initialization constructor.
1920
* @param brand String value for brand.
2021
* @param afterpayDetails AfterpayDetails value for afterpayDetails.
22+
* @param clearpayDetails ClearpayDetails value for clearpayDetails.
2123
*/
2224
@JsonCreator
2325
public BuyNowPayLaterDetails(
2426
@JsonProperty("brand") String brand,
25-
@JsonProperty("afterpay_details") AfterpayDetails afterpayDetails) {
27+
@JsonProperty("afterpay_details") AfterpayDetails afterpayDetails,
28+
@JsonProperty("clearpay_details") ClearpayDetails clearpayDetails) {
2629
this.brand = brand;
2730
this.afterpayDetails = afterpayDetails;
31+
this.clearpayDetails = clearpayDetails;
2832
}
2933

3034
/**
3135
* Getter for Brand.
32-
* The brand used for the Buy Now Pay Later payment. The brand can be `AFTERPAY` or `UNKNOWN`.
36+
* The brand used for the Buy Now Pay Later payment. The brand can be `AFTERPAY`, `CLEARPAY` or
37+
* `UNKNOWN`.
3338
* @return Returns the String
3439
*/
3540
@JsonGetter("brand")
@@ -49,9 +54,20 @@ public AfterpayDetails getAfterpayDetails() {
4954
return afterpayDetails;
5055
}
5156

57+
/**
58+
* Getter for ClearpayDetails.
59+
* Additional details about Clearpay payments.
60+
* @return Returns the ClearpayDetails
61+
*/
62+
@JsonGetter("clearpay_details")
63+
@JsonInclude(JsonInclude.Include.NON_NULL)
64+
public ClearpayDetails getClearpayDetails() {
65+
return clearpayDetails;
66+
}
67+
5268
@Override
5369
public int hashCode() {
54-
return Objects.hash(brand, afterpayDetails);
70+
return Objects.hash(brand, afterpayDetails, clearpayDetails);
5571
}
5672

5773
@Override
@@ -64,7 +80,8 @@ public boolean equals(Object obj) {
6480
}
6581
BuyNowPayLaterDetails other = (BuyNowPayLaterDetails) obj;
6682
return Objects.equals(brand, other.brand)
67-
&& Objects.equals(afterpayDetails, other.afterpayDetails);
83+
&& Objects.equals(afterpayDetails, other.afterpayDetails)
84+
&& Objects.equals(clearpayDetails, other.clearpayDetails);
6885
}
6986

7087
/**
@@ -74,7 +91,7 @@ public boolean equals(Object obj) {
7491
@Override
7592
public String toString() {
7693
return "BuyNowPayLaterDetails [" + "brand=" + brand + ", afterpayDetails=" + afterpayDetails
77-
+ "]";
94+
+ ", clearpayDetails=" + clearpayDetails + "]";
7895
}
7996

8097
/**
@@ -85,7 +102,8 @@ public String toString() {
85102
public Builder toBuilder() {
86103
Builder builder = new Builder()
87104
.brand(getBrand())
88-
.afterpayDetails(getAfterpayDetails());
105+
.afterpayDetails(getAfterpayDetails())
106+
.clearpayDetails(getClearpayDetails());
89107
return builder;
90108
}
91109

@@ -95,6 +113,7 @@ public Builder toBuilder() {
95113
public static class Builder {
96114
private String brand;
97115
private AfterpayDetails afterpayDetails;
116+
private ClearpayDetails clearpayDetails;
98117

99118

100119

@@ -118,12 +137,22 @@ public Builder afterpayDetails(AfterpayDetails afterpayDetails) {
118137
return this;
119138
}
120139

140+
/**
141+
* Setter for clearpayDetails.
142+
* @param clearpayDetails ClearpayDetails value for clearpayDetails.
143+
* @return Builder
144+
*/
145+
public Builder clearpayDetails(ClearpayDetails clearpayDetails) {
146+
this.clearpayDetails = clearpayDetails;
147+
return this;
148+
}
149+
121150
/**
122151
* Builds a new {@link BuyNowPayLaterDetails} object using the set fields.
123152
* @return {@link BuyNowPayLaterDetails}
124153
*/
125154
public BuyNowPayLaterDetails build() {
126-
return new BuyNowPayLaterDetails(brand, afterpayDetails);
155+
return new BuyNowPayLaterDetails(brand, afterpayDetails, clearpayDetails);
127156
}
128157
}
129158
}
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
2+
package com.squareup.square.models;
3+
4+
import com.fasterxml.jackson.annotation.JsonCreator;
5+
import com.fasterxml.jackson.annotation.JsonGetter;
6+
import com.fasterxml.jackson.annotation.JsonInclude;
7+
import com.fasterxml.jackson.annotation.JsonProperty;
8+
import java.util.Objects;
9+
10+
/**
11+
* This is a model class for ClearpayDetails type.
12+
*/
13+
public class ClearpayDetails {
14+
private final String emailAddress;
15+
16+
/**
17+
* Initialization constructor.
18+
* @param emailAddress String value for emailAddress.
19+
*/
20+
@JsonCreator
21+
public ClearpayDetails(
22+
@JsonProperty("email_address") String emailAddress) {
23+
this.emailAddress = emailAddress;
24+
}
25+
26+
/**
27+
* Getter for EmailAddress.
28+
* Email address on the buyer's Clearpay account.
29+
* @return Returns the String
30+
*/
31+
@JsonGetter("email_address")
32+
@JsonInclude(JsonInclude.Include.NON_NULL)
33+
public String getEmailAddress() {
34+
return emailAddress;
35+
}
36+
37+
@Override
38+
public int hashCode() {
39+
return Objects.hash(emailAddress);
40+
}
41+
42+
@Override
43+
public boolean equals(Object obj) {
44+
if (obj == this) {
45+
return true;
46+
}
47+
if (!(obj instanceof ClearpayDetails)) {
48+
return false;
49+
}
50+
ClearpayDetails other = (ClearpayDetails) obj;
51+
return Objects.equals(emailAddress, other.emailAddress);
52+
}
53+
54+
/**
55+
* Converts this ClearpayDetails into string format.
56+
* @return String representation of this class
57+
*/
58+
@Override
59+
public String toString() {
60+
return "ClearpayDetails [" + "emailAddress=" + emailAddress + "]";
61+
}
62+
63+
/**
64+
* Builds a new {@link ClearpayDetails.Builder} object.
65+
* Creates the instance with the state of the current model.
66+
* @return a new {@link ClearpayDetails.Builder} object
67+
*/
68+
public Builder toBuilder() {
69+
Builder builder = new Builder()
70+
.emailAddress(getEmailAddress());
71+
return builder;
72+
}
73+
74+
/**
75+
* Class to build instances of {@link ClearpayDetails}.
76+
*/
77+
public static class Builder {
78+
private String emailAddress;
79+
80+
81+
82+
/**
83+
* Setter for emailAddress.
84+
* @param emailAddress String value for emailAddress.
85+
* @return Builder
86+
*/
87+
public Builder emailAddress(String emailAddress) {
88+
this.emailAddress = emailAddress;
89+
return this;
90+
}
91+
92+
/**
93+
* Builds a new {@link ClearpayDetails} object using the set fields.
94+
* @return {@link ClearpayDetails}
95+
*/
96+
public ClearpayDetails build() {
97+
return new ClearpayDetails(emailAddress);
98+
}
99+
}
100+
}

src/main/java/com/squareup/square/utilities/WebhooksHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class WebhooksHelper {
2020
* @param signatureHeader The value for the {@code x-square-hmacsha256-signature} header.
2121
* @param signatureKey The signature key from the <a href="https://developer.squareup.com/apps">Square Developer portal</a> for the webhook subscription.
2222
* @param notificationUrl The notification endpoint URL as defined in the <a href="https://developer.squareup.com/apps">Square Developer portal</a> for the webhook subscription.
23-
* @return {@code true} if the signature is valid, indicating that the event can be trusted as it came from Square.
23+
* @return {@code true} if the signature is valid, indicating that the event can be trusted as it came from Square.<br/>
2424
* {@code false} if the signature validation fails, indicating that the event did not come from Square, so it may be malicious and should be discarded.
2525
*/
2626
public static boolean isValidWebhookEventSignature(String requestBody, String signatureHeader,

0 commit comments

Comments
 (0)