Skip to content

Commit 208a4ad

Browse files
Merge pull request #120 from square/release/40.1.1.20240717
Generated PR for Release: 40.1.1.20240717
2 parents ce5be46 + e693638 commit 208a4ad

26 files changed

+588
-572
lines changed

doc/api/apple-pay.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,11 @@ an Apple Pay enabled domain.
1818
This endpoint provides an easy way for platform developers to bulk activate
1919
Apple Pay on the Web with Square for merchants using their platform.
2020

21-
Note: The SqPaymentForm library is deprecated as of May 13, 2021, and will only receive critical security updates until it is retired on October 31, 2022.
22-
You must migrate your payment form code to the Web Payments SDK to continue using your domain for Apple Pay. For more information on migrating to the Web Payments SDK, see [Migrate to the Web Payments SDK](https://developer.squareup.com/docs/web-payments/migrate).
21+
Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The
22+
current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association,
23+
and should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your
24+
domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding
25+
long-lived caches that might not keep in sync with the correct file version.
2326

2427
To learn more about the Web Payments SDK and how to add Apple Pay, see [Take an Apple Pay Payment](https://developer.squareup.com/docs/web-payments/apple-pay).
2528

doc/api/invoices.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ invoicesApi.getInvoiceAsync(invoiceId).thenAccept(result -> {
288288

289289
# Update Invoice
290290

291-
Updates an invoice by modifying fields, clearing fields, or both. For most updates, you can use a sparse
292-
`Invoice` object to add fields or change values and use the `fields_to_clear` field to specify fields to clear.
293-
However, some restrictions apply. For example, you cannot change the `order_id` or `location_id` field and you
294-
must provide the complete `custom_fields` list to update a custom field. Published invoices have additional restrictions.
291+
Updates an invoice. This endpoint supports sparse updates, so you only need
292+
to specify the fields you want to change along with the required `version` field.
293+
Some restrictions apply to updating invoices. For example, you cannot change the
294+
`order_id` or `location_id` field.
295295

296296
```java
297297
CompletableFuture<UpdateInvoiceResponse> updateInvoiceAsync(
@@ -321,14 +321,19 @@ UpdateInvoiceRequest body = new UpdateInvoiceRequest.Builder(
321321
new InvoicePaymentRequest.Builder()
322322
.uid("2da7964f-f3d2-4f43-81e8-5aa220bf3355")
323323
.tippingEnabled(false)
324+
.reminders(Arrays.asList(
325+
new InvoicePaymentReminder.Builder()
326+
.build(),
327+
new InvoicePaymentReminder.Builder()
328+
.build(),
329+
new InvoicePaymentReminder.Builder()
330+
.build()
331+
))
324332
.build()
325333
))
326334
.build()
327335
)
328336
.idempotencyKey("4ee82288-0910-499e-ab4c-5d0071dad1be")
329-
.fieldsToClear(Arrays.asList(
330-
"payments_requests[2da7964f-f3d2-4f43-81e8-5aa220bf3355].reminders"
331-
))
332337
.build();
333338

334339
invoicesApi.updateInvoiceAsync(invoiceId, body).thenAccept(result -> {

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*: `"2024-06-04"` |
8+
| `squareVersion` | `String` | Square Connect API versions<br>*Default*: `"2024-07-17"` |
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` | [`Consumer<HttpClientConfiguration.Builder>`](http-client-configuration-builder.md) | Set up 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("2024-06-04")
22+
.squareVersion("2024-07-17")
2323
.bearerAuthCredentials(new BearerAuthModel.Builder(
2424
"AccessToken"
2525
)
@@ -44,7 +44,7 @@ public class Program {
4444
SquareClient client = new SquareClient.Builder()
4545
.httpClientConfig(configBuilder -> configBuilder
4646
.timeout(0))
47-
.squareVersion("2024-06-04")
47+
.squareVersion("2024-07-17")
4848
.bearerAuthCredentials(new BearerAuthModel.Builder(
4949
"AccessToken"
5050
)

doc/models/update-invoice-request.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@ Describes a `UpdateInvoice` request.
1313
| --- | --- | --- | --- | --- |
1414
| `Invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | Stores information about an invoice. You use the Invoices API to create and manage<br>invoices. For more information, see [Invoices API Overview](https://developer.squareup.com/docs/invoices-api/overview). | Invoice getInvoice() |
1515
| `IdempotencyKey` | `String` | Optional | A unique string that identifies the `UpdateInvoice` request. If you do not<br>provide `idempotency_key` (or provide an empty string as the value), the endpoint<br>treats each request as independent.<br><br>For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).<br>**Constraints**: *Maximum Length*: `128` | String getIdempotencyKey() |
16-
| `FieldsToClear` | `List<String>` | Optional | The list of fields to clear.<br>For examples, see [Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). | List<String> getFieldsToClear() |
16+
| `FieldsToClear` | `List<String>` | Optional | The list of fields to clear. Although this field is currently supported, we<br>recommend using null values or the `remove` field when possible. For examples, see<br>[Update an Invoice](https://developer.squareup.com/docs/invoices-api/update-invoices). | List<String> getFieldsToClear() |
1717

1818
## Example (as JSON)
1919

2020
```json
2121
{
22-
"fields_to_clear": [
23-
"payments_requests[2da7964f-f3d2-4f43-81e8-5aa220bf3355].reminders"
24-
],
2522
"idempotency_key": "4ee82288-0910-499e-ab4c-5d0071dad1be",
2623
"invoice": {
2724
"payment_requests": [
2825
{
26+
"reminders": null,
2927
"tipping_enabled": false,
3028
"uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355"
3129
}
@@ -47,7 +45,12 @@ Describes a `UpdateInvoice` request.
4745
"sublocality": "sublocality6"
4846
}
4947
}
50-
}
48+
},
49+
"fields_to_clear": [
50+
"fields_to_clear1",
51+
"fields_to_clear2",
52+
"fields_to_clear3"
53+
]
5154
}
5255
```
5356

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.squareup</groupId>
55
<artifactId>square</artifactId>
6-
<version>40.1.0.20240604</version>
6+
<version>40.1.1.20240717</version>
77
<packaging>jar</packaging>
88
<name>Square</name>
99
<description>Java client library for the Square API</description>
@@ -40,17 +40,17 @@
4040
<dependency>
4141
<groupId>io.apimatic</groupId>
4242
<artifactId>core-interfaces</artifactId>
43-
<version>[0.3, 0.4)</version>
43+
<version>[0.3.1, 0.4)</version>
4444
</dependency>
4545
<dependency>
4646
<groupId>io.apimatic</groupId>
4747
<artifactId>core</artifactId>
48-
<version>[0.6, 0.7)</version>
48+
<version>[0.6.3, 0.7)</version>
4949
</dependency>
5050
<dependency>
5151
<groupId>io.apimatic</groupId>
5252
<artifactId>okhttp-client-adapter</artifactId>
53-
<version>[0.3, 0.4)</version>
53+
<version>[0.3.1, 0.4)</version>
5454
</dependency>
5555
<dependency>
5656
<groupId>junit</groupId>

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ public interface Configuration {
7070
*/
7171
BearerAuthModel getBearerAuthModel();
7272

73-
/**
74-
* Get base URI by current environment.
75-
* @param server Server for which to get the base URI
76-
* @return Processed base URI
77-
*/
78-
String getBaseUri(Server server);
79-
80-
/**
81-
* Get base URI by current environment.
82-
* @return Processed base URI
83-
*/
84-
String getBaseUri();
85-
}
73+
/**
74+
* Get base URI by current environment.
75+
* @param server Server for which to get the base URI
76+
* @return Processed base URI
77+
*/
78+
String getBaseUri(Server server);
79+
80+
/**
81+
* Get base URI by current environment.
82+
* @return Processed base URI
83+
*/
84+
String getBaseUri();
85+
}

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ public enum Environment {
4040
*/
4141
@JsonCreator
4242
public static Environment constructFromString(String toConvert) throws IOException {
43-
Environment enumValue = fromString(toConvert);
44-
if (enumValue == null) {
45-
throw new IOException("Unable to create enum instance with value: " + toConvert);
46-
}
47-
return enumValue;
48-
}
49-
50-
/**
43+
Environment enumValue = fromString(toConvert);
44+
if (enumValue == null) {
45+
throw new IOException("Unable to create enum instance with value: " + toConvert);
46+
}
47+
return enumValue;
48+
}
49+
50+
/**
5151
* Returns the enum member associated with the given string value.
5252
* @param toConvert String value to get enum member.
5353
* @return The enum member against the given string value.

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ public enum Server {
3232
*/
3333
@JsonCreator
3434
public static Server constructFromString(String toConvert) throws IOException {
35-
Server enumValue = fromString(toConvert);
36-
if (enumValue == null) {
37-
throw new IOException("Unable to create enum instance with value: " + toConvert);
38-
}
39-
return enumValue;
40-
}
41-
42-
/**
35+
Server enumValue = fromString(toConvert);
36+
if (enumValue == null) {
37+
throw new IOException("Unable to create enum instance with value: " + toConvert);
38+
}
39+
return enumValue;
40+
}
41+
42+
/**
4343
* Returns the enum member associated with the given string value.
4444
* @param toConvert String value to get enum member.
4545
* @return The enum member against the given string value.

0 commit comments

Comments
 (0)