Skip to content

Commit 5b0059b

Browse files
authored
Merge pull request #87 from square/release/24.0.0.20220921
2 parents d74ac0a + 91c16e1 commit 5b0059b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+310
-296
lines changed

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88

99
Use this library to integrate Square payments into your app and grow your business with Square APIs including Catalog, Customers, Employees, Inventory, Labor, Locations, and Orders.
1010

11+
* [Requirements](#requirements)
12+
* [Installation](#installation)
13+
* [Quickstart](#quickstart)
14+
* [Usage](#usage)
15+
* [Tests](#tests)
16+
* [SDK Reference](#sdk-reference)
17+
* [Deprecated APIs](#deprecated-apis)
18+
1119
## Requirements
1220

1321
Use of the Square Java SDK requires:
@@ -109,16 +117,17 @@ mvn test
109117
* [Sites]
110118
* [Snippets]
111119

112-
### Authorization APIs
120+
### Authorization
113121
* [Mobile Authorization]
114122
* [OAuth]
115123

116-
### Deprecated APIs
117-
* [Employees]
118-
* [V1 Employees]
119-
* [V1 Transactions]
120-
* [V1 Items]
121-
* [Transactions]
124+
## Deprecated APIs
125+
126+
The following Square APIs are [deprecated](https://developer.squareup.com/docs/build-basics/api-lifecycle):
127+
128+
* [Employees] - replaced by the [Team] API. For more information, see [Migrate from the Employees API](https://developer.squareup.com/docs/team/migrate-from-v2-employees).
129+
130+
* [Transactions] - replaced by the [Orders] and [Payments] APIs. For more information, see [Migrate from the Transactions API](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api).
122131

123132
#### Usage Notes for V1 Transactions
124133

@@ -150,7 +159,6 @@ You'll also need to provide logic to handle paginated results. For more informa
150159
[Catalog]: doc/api/catalog.md
151160
[Customers]: doc/api/customers.md
152161
[Customer Custom Attributes]: doc/api/customer-custom-attributes.md
153-
[Employees]: doc/api/employees.md
154162
[Inventory]: doc/api/inventory.md
155163
[Labor]: doc/api/labor.md
156164
[Loyalty]: doc/api/loyalty.md
@@ -164,14 +172,12 @@ You'll also need to provide logic to handle paginated results. For more informa
164172
[Subscriptions]: doc/api/subscriptions.md
165173
[Mobile Authorization]: doc/api/mobile-authorization.md
166174
[OAuth]: doc/api/o-auth.md
167-
[V1 Employees]: doc/api/v1-employees.md
168-
[V1 Transactions]: doc/api/v1-transactions.md
169-
[V1 Items]: doc/api/v1-items.md
170175
[Team]: doc/api/team.md
171-
[Transactions]: doc/api/transactions.md
172176
[Sites]: doc/api/sites.md
173177
[Snippets]: doc/api/snippets.md
174178
[Cards]: doc/api/cards.md
175179
[Payouts]: doc/api/payouts.md
176180
[Gift Cards]: doc/api/gift-cards.md
177181
[Gift Card Activities]: doc/api/gift-card-activities.md
182+
[Employees]: doc/api/employees.md
183+
[Transactions]: doc/api/transactions.md

doc/api/apple-pay.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ 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-
To learn more about Web Apple Pay, see
22-
[Add the Apple Pay on the Web Button](https://developer.squareup.com/docs/payment-form/add-digital-wallets/apple-pay).
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).
23+
24+
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).
2325

2426
```java
2527
CompletableFuture<RegisterDomainResponse> registerDomainAsync(

doc/api/invoices.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ Invoice invoice = new Invoice.Builder()
141141
.acceptedPaymentMethods(invoiceAcceptedPaymentMethods)
142142
.customFields(invoiceCustomFields)
143143
.saleOrServiceDate("2030-01-24")
144+
.storePaymentMethodEnabled(false)
144145
.build();
145146
CreateInvoiceRequest body = new CreateInvoiceRequest.Builder(
146147
invoice)

doc/api/loyalty.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ Adds points earned from a purchase to a [loyalty account](../../doc/models/loyal
170170
- If you are not using the Orders API to manage orders, provide `points` with the number of points to add.
171171
You must first perform a client-side computation of the points earned from the loyalty program and
172172
loyalty promotion. For spend-based and visit-based programs, you can call [CalculateLoyaltyPoints](../../doc/api/loyalty.md#calculate-loyalty-points)
173-
to compute the points earned from the loyalty program (but not points earned from a loyalty promotion).
173+
to compute the points earned from the base loyalty program. For information about computing points earned from a loyalty promotion, see
174+
[Calculating promotion points](https://developer.squareup.com/docs/loyalty-api/loyalty-promotions#calculate-promotion-points).
174175

175176
```java
176177
CompletableFuture<AccumulateLoyaltyPointsResponse> accumulateLoyaltyPointsAsync(

doc/api/v1-transactions.md

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ V1TransactionsApi v1TransactionsApi = client.getV1TransactionsApi();
1010

1111
## Methods
1212

13-
* [List Orders](../../doc/api/v1-transactions.md#list-orders)
14-
* [Retrieve Order](../../doc/api/v1-transactions.md#retrieve-order)
15-
* [Update Order](../../doc/api/v1-transactions.md#update-order)
16-
* [List Payments](../../doc/api/v1-transactions.md#list-payments)
17-
* [Retrieve Payment](../../doc/api/v1-transactions.md#retrieve-payment)
18-
* [List Refunds](../../doc/api/v1-transactions.md#list-refunds)
19-
* [Create Refund](../../doc/api/v1-transactions.md#create-refund)
20-
* [List Settlements](../../doc/api/v1-transactions.md#list-settlements)
21-
* [Retrieve Settlement](../../doc/api/v1-transactions.md#retrieve-settlement)
13+
* [V1 List Orders](../../doc/api/v1-transactions.md#v1-list-orders)
14+
* [V1 Retrieve Order](../../doc/api/v1-transactions.md#v1-retrieve-order)
15+
* [V1 Update Order](../../doc/api/v1-transactions.md#v1-update-order)
16+
* [V1 List Payments](../../doc/api/v1-transactions.md#v1-list-payments)
17+
* [V1 Retrieve Payment](../../doc/api/v1-transactions.md#v1-retrieve-payment)
18+
* [V1 List Refunds](../../doc/api/v1-transactions.md#v1-list-refunds)
19+
* [V1 Create Refund](../../doc/api/v1-transactions.md#v1-create-refund)
20+
* [V1 List Settlements](../../doc/api/v1-transactions.md#v1-list-settlements)
21+
* [V1 Retrieve Settlement](../../doc/api/v1-transactions.md#v1-retrieve-settlement)
2222

2323

24-
# List Orders
24+
# V1 List Orders
2525

2626
**This endpoint is deprecated.**
2727

2828
Provides summary information for a merchant's online store orders.
2929

3030
```java
31-
CompletableFuture<List<V1Order>> listOrdersAsync(
31+
CompletableFuture<List<V1Order>> v1ListOrdersAsync(
3232
final String locationId,
3333
final String order,
3434
final Integer limit,
@@ -53,7 +53,7 @@ CompletableFuture<List<V1Order>> listOrdersAsync(
5353
```java
5454
String locationId = "location_id4";
5555

56-
v1TransactionsApi.listOrdersAsync(locationId, null, null, null).thenAccept(result -> {
56+
v1TransactionsApi.v1ListOrdersAsync(locationId, null, null, null).thenAccept(result -> {
5757
// TODO success callback handler
5858
}).exceptionally(exception -> {
5959
// TODO failure callback handler
@@ -62,14 +62,14 @@ v1TransactionsApi.listOrdersAsync(locationId, null, null, null).thenAccept(resul
6262
```
6363

6464

65-
# Retrieve Order
65+
# V1 Retrieve Order
6666

6767
**This endpoint is deprecated.**
6868

6969
Provides comprehensive information for a single online store order, including the order's history.
7070

7171
```java
72-
CompletableFuture<V1Order> retrieveOrderAsync(
72+
CompletableFuture<V1Order> v1RetrieveOrderAsync(
7373
final String locationId,
7474
final String orderId)
7575
```
@@ -91,7 +91,7 @@ CompletableFuture<V1Order> retrieveOrderAsync(
9191
String locationId = "location_id4";
9292
String orderId = "order_id6";
9393

94-
v1TransactionsApi.retrieveOrderAsync(locationId, orderId).thenAccept(result -> {
94+
v1TransactionsApi.v1RetrieveOrderAsync(locationId, orderId).thenAccept(result -> {
9595
// TODO success callback handler
9696
}).exceptionally(exception -> {
9797
// TODO failure callback handler
@@ -100,14 +100,14 @@ v1TransactionsApi.retrieveOrderAsync(locationId, orderId).thenAccept(result -> {
100100
```
101101

102102

103-
# Update Order
103+
# V1 Update Order
104104

105105
**This endpoint is deprecated.**
106106

107107
Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions:
108108

109109
```java
110-
CompletableFuture<V1Order> updateOrderAsync(
110+
CompletableFuture<V1Order> v1UpdateOrderAsync(
111111
final String locationId,
112112
final String orderId,
113113
final V1UpdateOrderRequest body)
@@ -134,7 +134,7 @@ V1UpdateOrderRequest body = new V1UpdateOrderRequest.Builder(
134134
"REFUND")
135135
.build();
136136

137-
v1TransactionsApi.updateOrderAsync(locationId, orderId, body).thenAccept(result -> {
137+
v1TransactionsApi.v1UpdateOrderAsync(locationId, orderId, body).thenAccept(result -> {
138138
// TODO success callback handler
139139
}).exceptionally(exception -> {
140140
// TODO failure callback handler
@@ -143,7 +143,7 @@ v1TransactionsApi.updateOrderAsync(locationId, orderId, body).thenAccept(result
143143
```
144144

145145

146-
# List Payments
146+
# V1 List Payments
147147

148148
**This endpoint is deprecated.**
149149

@@ -160,7 +160,7 @@ list an offline payment chronologically between online payments that
160160
were seen in a previous request.
161161

162162
```java
163-
CompletableFuture<List<V1Payment>> listPaymentsAsync(
163+
CompletableFuture<List<V1Payment>> v1ListPaymentsAsync(
164164
final String locationId,
165165
final String order,
166166
final String beginTime,
@@ -192,7 +192,7 @@ CompletableFuture<List<V1Payment>> listPaymentsAsync(
192192
String locationId = "location_id4";
193193
Boolean includePartial = false;
194194

195-
v1TransactionsApi.listPaymentsAsync(locationId, null, null, null, null, null, includePartial).thenAccept(result -> {
195+
v1TransactionsApi.v1ListPaymentsAsync(locationId, null, null, null, null, null, includePartial).thenAccept(result -> {
196196
// TODO success callback handler
197197
}).exceptionally(exception -> {
198198
// TODO failure callback handler
@@ -201,14 +201,14 @@ v1TransactionsApi.listPaymentsAsync(locationId, null, null, null, null, null, in
201201
```
202202

203203

204-
# Retrieve Payment
204+
# V1 Retrieve Payment
205205

206206
**This endpoint is deprecated.**
207207

208208
Provides comprehensive information for a single payment.
209209

210210
```java
211-
CompletableFuture<V1Payment> retrievePaymentAsync(
211+
CompletableFuture<V1Payment> v1RetrievePaymentAsync(
212212
final String locationId,
213213
final String paymentId)
214214
```
@@ -230,7 +230,7 @@ CompletableFuture<V1Payment> retrievePaymentAsync(
230230
String locationId = "location_id4";
231231
String paymentId = "payment_id0";
232232

233-
v1TransactionsApi.retrievePaymentAsync(locationId, paymentId).thenAccept(result -> {
233+
v1TransactionsApi.v1RetrievePaymentAsync(locationId, paymentId).thenAccept(result -> {
234234
// TODO success callback handler
235235
}).exceptionally(exception -> {
236236
// TODO failure callback handler
@@ -239,14 +239,14 @@ v1TransactionsApi.retrievePaymentAsync(locationId, paymentId).thenAccept(result
239239
```
240240

241241

242-
# List Refunds
242+
# V1 List Refunds
243243

244244
**This endpoint is deprecated.**
245245

246246
Provides the details for all refunds initiated by a merchant or any of the merchant's mobile staff during a date range. Date ranges cannot exceed one year in length.
247247

248248
```java
249-
CompletableFuture<List<V1Refund>> listRefundsAsync(
249+
CompletableFuture<List<V1Refund>> v1ListRefundsAsync(
250250
final String locationId,
251251
final String order,
252252
final String beginTime,
@@ -275,7 +275,7 @@ CompletableFuture<List<V1Refund>> listRefundsAsync(
275275
```java
276276
String locationId = "location_id4";
277277

278-
v1TransactionsApi.listRefundsAsync(locationId, null, null, null, null, null).thenAccept(result -> {
278+
v1TransactionsApi.v1ListRefundsAsync(locationId, null, null, null, null, null).thenAccept(result -> {
279279
// TODO success callback handler
280280
}).exceptionally(exception -> {
281281
// TODO failure callback handler
@@ -284,7 +284,7 @@ v1TransactionsApi.listRefundsAsync(locationId, null, null, null, null, null).the
284284
```
285285

286286

287-
# Create Refund
287+
# V1 Create Refund
288288

289289
**This endpoint is deprecated.**
290290

@@ -302,7 +302,7 @@ purposes, you can create fake cash payments in Square Point of Sale and
302302
refund them.
303303

304304
```java
305-
CompletableFuture<V1Refund> createRefundAsync(
305+
CompletableFuture<V1Refund> v1CreateRefundAsync(
306306
final String locationId,
307307
final V1CreateRefundRequest body)
308308
```
@@ -328,7 +328,7 @@ V1CreateRefundRequest body = new V1CreateRefundRequest.Builder(
328328
"reason8")
329329
.build();
330330

331-
v1TransactionsApi.createRefundAsync(locationId, body).thenAccept(result -> {
331+
v1TransactionsApi.v1CreateRefundAsync(locationId, body).thenAccept(result -> {
332332
// TODO success callback handler
333333
}).exceptionally(exception -> {
334334
// TODO failure callback handler
@@ -337,7 +337,7 @@ v1TransactionsApi.createRefundAsync(locationId, body).thenAccept(result -> {
337337
```
338338

339339

340-
# List Settlements
340+
# V1 List Settlements
341341

342342
**This endpoint is deprecated.**
343343

@@ -349,7 +349,7 @@ ranges cannot exceed one year in length.
349349
information.
350350

351351
```java
352-
CompletableFuture<List<V1Settlement>> listSettlementsAsync(
352+
CompletableFuture<List<V1Settlement>> v1ListSettlementsAsync(
353353
final String locationId,
354354
final String order,
355355
final String beginTime,
@@ -380,7 +380,7 @@ CompletableFuture<List<V1Settlement>> listSettlementsAsync(
380380
```java
381381
String locationId = "location_id4";
382382

383-
v1TransactionsApi.listSettlementsAsync(locationId, null, null, null, null, null, null).thenAccept(result -> {
383+
v1TransactionsApi.v1ListSettlementsAsync(locationId, null, null, null, null, null, null).thenAccept(result -> {
384384
// TODO success callback handler
385385
}).exceptionally(exception -> {
386386
// TODO failure callback handler
@@ -389,7 +389,7 @@ v1TransactionsApi.listSettlementsAsync(locationId, null, null, null, null, null,
389389
```
390390

391391

392-
# Retrieve Settlement
392+
# V1 Retrieve Settlement
393393

394394
**This endpoint is deprecated.**
395395

@@ -412,7 +412,7 @@ a bank account within 3 business days, but in exceptional cases it may
412412
take longer.
413413

414414
```java
415-
CompletableFuture<V1Settlement> retrieveSettlementAsync(
415+
CompletableFuture<V1Settlement> v1RetrieveSettlementAsync(
416416
final String locationId,
417417
final String settlementId)
418418
```
@@ -434,7 +434,7 @@ CompletableFuture<V1Settlement> retrieveSettlementAsync(
434434
String locationId = "location_id4";
435435
String settlementId = "settlement_id0";
436436

437-
v1TransactionsApi.retrieveSettlementAsync(locationId, settlementId).thenAccept(result -> {
437+
v1TransactionsApi.v1RetrieveSettlementAsync(locationId, settlementId).thenAccept(result -> {
438438
// TODO success callback handler
439439
}).exceptionally(exception -> {
440440
// TODO failure callback handler

doc/api/webhook-subscriptions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ CompletableFuture<ListWebhookSubscriptionsResponse> listWebhookSubscriptionsAsyn
7070
| `cursor` | `String` | Query, Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this to retrieve the next set of results for your original query.<br><br>For more information, see [Pagination](https://developer.squareup.com/docs/basics/api101/pagination). |
7171
| `includeDisabled` | `Boolean` | Query, Optional | Includes disabled [Subscription](../../doc/models/webhook-subscription.md)s.<br>By default, all enabled [Subscription](../../doc/models/webhook-subscription.md)s are returned.<br>**Default**: `false` |
7272
| `sortOrder` | [`String`](../../doc/models/sort-order.md) | Query, Optional | Sorts the returned list by when the [Subscription](../../doc/models/webhook-subscription.md) was created with the specified order.<br>This field defaults to ASC. |
73-
| `limit` | `Integer` | Query, Optional | The maximum number of results to be returned in a single page.<br>It is possible to receive fewer results than the specified limit on a given page.<br>The default value of 100 is also the maximum allowed value. If the provided value is greater<br>than 100, it is ignored and the default value is used instead.<br><br>Default: 100 |
73+
| `limit` | `Integer` | Query, Optional | The maximum number of results to be returned in a single page.<br>It is possible to receive fewer results than the specified limit on a given page.<br>The default value of 100 is also the maximum allowed value.<br><br>Default: 100 |
7474

7575
## Response Type
7676

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-23"` |
8+
| `squareVersion` | `String` | Square Connect API versions<br>*Default*: `"2022-09-21"` |
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-23")
22+
.squareVersion("2022-09-21")
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-23")
48+
.squareVersion("2022-09-21")
4949
.accessToken("AccessToken")
5050
.build();
5151

doc/models/accumulate-loyalty-points-response.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Represents an [AccumulateLoyaltyPoints](../../doc/api/loyalty.md#accumulate-loya
1313
| --- | --- | --- | --- | --- |
1414
| `Errors` | [`List<Error>`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | List<Error> getErrors() |
1515
| `Event` | [`LoyaltyEvent`](../../doc/models/loyalty-event.md) | Optional | Provides information about a loyalty event.<br>For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events). | LoyaltyEvent getEvent() |
16-
| `Events` | [`List<LoyaltyEvent>`](../../doc/models/loyalty-event.md) | Optional | The resulting loyalty events. The `ACCUMULATE_POINTS` event is always included.<br>When using the Orders API, the `ACCUMULATE_PROMOTION_POINTS` event is included<br>if the purchase also qualifies for a loyalty promotion. | List<LoyaltyEvent> getEvents() |
16+
| `Events` | [`List<LoyaltyEvent>`](../../doc/models/loyalty-event.md) | Optional | The resulting loyalty events. If the purchase qualifies for points, the `ACCUMULATE_POINTS` event<br>is always included. When using the Orders API, the `ACCUMULATE_PROMOTION_POINTS` event is included<br>if the purchase also qualifies for a loyalty promotion. | List<LoyaltyEvent> getEvents() |
1717

1818
## Example (as JSON)
1919

0 commit comments

Comments
 (0)