Skip to content

Commit

Permalink
Merge pull request #120 from square/release/40.1.1.20240717
Browse files Browse the repository at this point in the history
Generated PR for Release: 40.1.1.20240717
  • Loading branch information
jessdelacruzsantos authored Jul 17, 2024
2 parents ce5be46 + e693638 commit 208a4ad
Show file tree
Hide file tree
Showing 26 changed files with 588 additions and 572 deletions.
7 changes: 5 additions & 2 deletions doc/api/apple-pay.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ an Apple Pay enabled domain.
This endpoint provides an easy way for platform developers to bulk activate
Apple Pay on the Web with Square for merchants using their platform.

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.
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).
Note: You will need to host a valid domain verification file on your domain to support Apple Pay. The
current version of this file is always available at https://app.squareup.com/digital-wallets/apple-pay/apple-developer-merchantid-domain-association,
and should be hosted at `.well_known/apple-developer-merchantid-domain-association` on your
domain. This file is subject to change; we strongly recommend checking for updates regularly and avoiding
long-lived caches that might not keep in sync with the correct file version.

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).

Expand Down
19 changes: 12 additions & 7 deletions doc/api/invoices.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,10 @@ invoicesApi.getInvoiceAsync(invoiceId).thenAccept(result -> {

# Update Invoice

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

```java
CompletableFuture<UpdateInvoiceResponse> updateInvoiceAsync(
Expand Down Expand Up @@ -321,14 +321,19 @@ UpdateInvoiceRequest body = new UpdateInvoiceRequest.Builder(
new InvoicePaymentRequest.Builder()
.uid("2da7964f-f3d2-4f43-81e8-5aa220bf3355")
.tippingEnabled(false)
.reminders(Arrays.asList(
new InvoicePaymentReminder.Builder()
.build(),
new InvoicePaymentReminder.Builder()
.build(),
new InvoicePaymentReminder.Builder()
.build()
))
.build()
))
.build()
)
.idempotencyKey("4ee82288-0910-499e-ab4c-5d0071dad1be")
.fieldsToClear(Arrays.asList(
"payments_requests[2da7964f-f3d2-4f43-81e8-5aa220bf3355].reminders"
))
.build();

invoicesApi.updateInvoiceAsync(invoiceId, body).thenAccept(result -> {
Expand Down
6 changes: 3 additions & 3 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:

| Parameter | Type | Description |
| --- | --- | --- |
| `squareVersion` | `String` | Square Connect API versions<br>*Default*: `"2024-06-04"` |
| `squareVersion` | `String` | Square Connect API versions<br>*Default*: `"2024-07-17"` |
| `customUrl` | `String` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `"https://connect.squareup.com"` |
| `environment` | `string` | The API environment. <br> **Default: `production`** |
| `httpClientConfig` | [`Consumer<HttpClientConfiguration.Builder>`](http-client-configuration-builder.md) | Set up Http Client Configuration instance. |
Expand All @@ -19,7 +19,7 @@ The API client can be initialized as follows:
SquareClient client = new SquareClient.Builder()
.httpClientConfig(configBuilder -> configBuilder
.timeout(0))
.squareVersion("2024-06-04")
.squareVersion("2024-07-17")
.bearerAuthCredentials(new BearerAuthModel.Builder(
"AccessToken"
)
Expand All @@ -44,7 +44,7 @@ public class Program {
SquareClient client = new SquareClient.Builder()
.httpClientConfig(configBuilder -> configBuilder
.timeout(0))
.squareVersion("2024-06-04")
.squareVersion("2024-07-17")
.bearerAuthCredentials(new BearerAuthModel.Builder(
"AccessToken"
)
Expand Down
13 changes: 8 additions & 5 deletions doc/models/update-invoice-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,17 @@ Describes a `UpdateInvoice` request.
| --- | --- | --- | --- | --- |
| `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() |
| `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() |
| `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() |
| `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() |

## Example (as JSON)

```json
{
"fields_to_clear": [
"payments_requests[2da7964f-f3d2-4f43-81e8-5aa220bf3355].reminders"
],
"idempotency_key": "4ee82288-0910-499e-ab4c-5d0071dad1be",
"invoice": {
"payment_requests": [
{
"reminders": null,
"tipping_enabled": false,
"uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355"
}
Expand All @@ -47,7 +45,12 @@ Describes a `UpdateInvoice` request.
"sublocality": "sublocality6"
}
}
}
},
"fields_to_clear": [
"fields_to_clear1",
"fields_to_clear2",
"fields_to_clear3"
]
}
```

8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.squareup</groupId>
<artifactId>square</artifactId>
<version>40.1.0.20240604</version>
<version>40.1.1.20240717</version>
<packaging>jar</packaging>
<name>Square</name>
<description>Java client library for the Square API</description>
Expand Down Expand Up @@ -40,17 +40,17 @@
<dependency>
<groupId>io.apimatic</groupId>
<artifactId>core-interfaces</artifactId>
<version>[0.3, 0.4)</version>
<version>[0.3.1, 0.4)</version>
</dependency>
<dependency>
<groupId>io.apimatic</groupId>
<artifactId>core</artifactId>
<version>[0.6, 0.7)</version>
<version>[0.6.3, 0.7)</version>
</dependency>
<dependency>
<groupId>io.apimatic</groupId>
<artifactId>okhttp-client-adapter</artifactId>
<version>[0.3, 0.4)</version>
<version>[0.3.1, 0.4)</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
26 changes: 13 additions & 13 deletions src/main/java/com/squareup/square/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ public interface Configuration {
*/
BearerAuthModel getBearerAuthModel();

/**
* Get base URI by current environment.
* @param server Server for which to get the base URI
* @return Processed base URI
*/
String getBaseUri(Server server);

/**
* Get base URI by current environment.
* @return Processed base URI
*/
String getBaseUri();
}
/**
* Get base URI by current environment.
* @param server Server for which to get the base URI
* @return Processed base URI
*/
String getBaseUri(Server server);

/**
* Get base URI by current environment.
* @return Processed base URI
*/
String getBaseUri();
}
16 changes: 8 additions & 8 deletions src/main/java/com/squareup/square/Environment.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public enum Environment {
*/
@JsonCreator
public static Environment constructFromString(String toConvert) throws IOException {
Environment enumValue = fromString(toConvert);
if (enumValue == null) {
throw new IOException("Unable to create enum instance with value: " + toConvert);
}
return enumValue;
}

/**
Environment enumValue = fromString(toConvert);
if (enumValue == null) {
throw new IOException("Unable to create enum instance with value: " + toConvert);
}
return enumValue;
}

/**
* Returns the enum member associated with the given string value.
* @param toConvert String value to get enum member.
* @return The enum member against the given string value.
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/squareup/square/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public enum Server {
*/
@JsonCreator
public static Server constructFromString(String toConvert) throws IOException {
Server enumValue = fromString(toConvert);
if (enumValue == null) {
throw new IOException("Unable to create enum instance with value: " + toConvert);
}
return enumValue;
}

/**
Server enumValue = fromString(toConvert);
if (enumValue == null) {
throw new IOException("Unable to create enum instance with value: " + toConvert);
}
return enumValue;
}

/**
* Returns the enum member associated with the given string value.
* @param toConvert String value to get enum member.
* @return The enum member against the given string value.
Expand Down
Loading

0 comments on commit 208a4ad

Please sign in to comment.