Skip to content

Commit dc02d72

Browse files
author
Wolfgang Schuster
authored
Merge pull request #65 from square/release/16.0.0.20211020
Generated PR for Release: 16.0.0.20211020
2 parents 2572f52 + 380f646 commit dc02d72

File tree

107 files changed

+1708
-1307
lines changed

Some content is hidden

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

107 files changed

+1708
-1307
lines changed

.github/labeler.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
# configuration settings for labeler
23

34
version: v1

.github/workflows/maven.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,22 @@ jobs:
2626
distribution: "adopt"
2727
- name: Build with Maven
2828
run: mvn test -B
29+
30+
labeler:
31+
needs: build
32+
if: ${{ github.event_name == 'pull_request' }}
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: automerge-labeler
36+
uses: fuxingloh/multi-labeler@v1
37+
38+
automerge:
39+
needs: labeler
40+
if: ${{ github.event_name == 'pull_request' }}
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: automerge
44+
uses: "pascalgn/[email protected]"
45+
env:
46+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
47+
MERGE_LABELS: "automerge,automerge-branch,automerge-author"

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
# Change Log
22

3+
## Version 16.0.0.20211020 (2021-10-20)
4+
## API updates
5+
* **Transactions API.** Three previously deprecated endpoints (`ListRefunds`, `Charge`, and `CreateRefund`) in the [Transactions API](https://developer.squareup.com/reference/square_2021-10-20/transactions-api) are removed from Square API version 2021-10-20 and later. These endpoints will work if you are using Square API versions prior to 2021-10-20. However, these endpoints will eventually be retired from all Square versions.
6+
7+
* Instead of the Transactions API `Charge` endpoint, use the Payments API [CreatePayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment) endpoint.
8+
* Instead of the Transactions API `CreateRefund` endpoint, use the Refunds API [RefundPayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/refund-payment) endpoint.
9+
* Instead of the Transactions API `ListRefunds` endpoint, use the Refunds API [ListPaymentRefund](https://developer.squareup.com/reference/square_2021-10-20/payments-api/list-payment-refunds) endpoint.
10+
11+
* **Payments API:**
12+
* [Payment](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment) object.
13+
* Added the [device_details](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-device_details) read-only field to view details of the device used to take a payment. This `Payment`-level field provides device information for all types of payments. Previously, device details were only available for card payments (`Payment.card_details.device_details`), which is now deprecated.
14+
* Added the [team_member_id](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-team_member_id) that applications can use to view the ID of the [TeamMember](https://developer.squareup.com/reference/square_2021-10-20/objects/TeamMember) associated with the payment. Use this field instead of the `Payment.employee_id` field, which is now deprecated.
15+
* Added the [application_details](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-application_details) read-only field to view details of the application that took the payment.
16+
17+
* These `Payment` fields have moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle) (GA) state:[tip_money](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-tip_money), [delay_duration](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delay_duration), [statement_description_identifier](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-statement_description_identifier), [delay_duration](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delay_duration), [delay_action](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delay_action), [delayed_until](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delayed_until), and [statement_description_identifier](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-statement_description_identifier).
18+
19+
* The [ACH Bank Transfer Payments](https://developer.squareup.com/docs/payments-api/take-payments/ach-payments) feature has moved to the GA state. Accordingly, the [bank_account_details](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-bank_account_details) field (and its [BankAccountPaymentDetails](https://developer.squareup.com/reference/square_2021-10-20/objects/BankAccountPaymentDetails) type) are moved to the GA state.
20+
* [CreatePayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment) endpoint.
21+
* Added the [team_member_id](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment#request__property-team_member_id) request field to record the ID of the team member associated with the payment.
22+
* The [accept_partial_authorization](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment#request__property-accept_partial_authorization) request field has moved to the GA state.
23+
* [CompletePayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/complete-payment) endpoint. Added the `version_token` request field to support optimistic concurrency. For more information, see [Delayed capture of a card payment.](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment)
24+
25+
* **Refunds API:**
26+
* [RefundPayment](https://developer.squareup.com/reference/square_2021-10-20/refunds-api/refund-payment) endpoint.
27+
* Added the `team_member_id` request field to record the ID of the team member associated with the refund.
28+
* Added the `payment_version_token` request field to support optimistic concurrency. For more information, see [Refund Payment.](https://developer.squareup.com/docs/payments-api/refund-payments#optimistic-concurrency)
29+
30+
* **Customers API:**
31+
* [Customer](https://developer.squareup.com/reference/square_2021-10-20/objects/Customer) object. Added a new `tax_ids` field of the [CustomerTaxIds](https://developer.squareup.com/reference/square_2021-10-20/objects/CustomerTaxIds) type, which can contain the EU VAT ID of the customer. This field is available only for customers of sellers in France, Ireland, or the United Kingdom. For more information, see [Customer tax IDs.](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids)
32+
33+
* [UpdateCustomer](https://developer.squareup.com/reference/square_2021-10-20/customers-api/update-customer) endpoint. The Customers API now returns a `400 BAD_REQUEST` error if the request body does not contain any fields. For earlier Square versions, the Customers API will continue to return a `200 OK` response along with the customer profile. For more information, see [Migration notes.](https://developer.squareup.com/docs/customers-api/what-it-does#migration-notes)
34+
35+
* **Invoices API:**
36+
* [InvoiceRecipient](https://developer.squareup.com/reference/square_2021-10-20/objects/InvoiceRecipient) object. Added a new, read-only `tax_ids` field of the [InvoiceRecipientTaxIds](https://developer.squareup.com/reference/square_2021-10-20/objects/InvoiceRecipientTaxIds) type, which can contain the EU VAT ID of the invoice recipient. This field is available only for customers of sellers in Ireland or the United Kingdom. If defined, `tax_ids` is returned for all Square API versions. For more information, see [Invoice recipient tax IDs.](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids)
37+
* Square now sends emails for test invoices that are published in the Sandbox environment.
38+
39+
* **Catalog API:**
40+
* [CatalogSubscriptionPlan.name](https://developer.squareup.com/reference/square_2021-10-20/objects/CatalogSubscriptionPlan#definition__property-name) can be updated after the subscription plan is created. The change is retroactively applicable to prior versions of the Square API.
41+
42+
* **Subscriptions API:**
43+
* The new [SubscriptionSource](https://developer.squareup.com/reference/square_2021-10-20/objects/SubscriptionSource) data type is introduced to encapsulate the source where a subscription is created. The new `SubscriptionSource.name` value is propagated to the `Order.source` attribute when an order is made on the subscription. The new feature is retroactively applicable to prior versions of the Square API.
44+
* The new [Subscription.source](https://developer.squareup.com/reference/square_2021-10-20/objects/Subscription#definition__property-source) attribute is introduced to indicate the source where the subscription was created. This new feature is retroactively applicable to prior versions of the Square API.
45+
* The new [SearchSubscriptionsFilter.source_names](https://developer.squareup.com/reference/square_2021-10-20/objects/SearchSubscriptionFilter#definition__property-source_names) query expression is introduced to enable search for subscriptions by the subscription source name. This new feature is retroactively applicable to prior versions of the Square API.
46+
47+
348
## Version 15.1.0.20210915 (2021-09-15)
449
## API updates
550

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Install the client dynamically by adding a dependency to the POM for your projec
3333
<dependency>
3434
<groupId>com.squareup</groupId>
3535
<artifactId>square</artifactId>
36-
<version>15.1.0.20210915</version>
36+
<version>16.0.0.20211020</version>
3737
</dependency>
3838
```
3939

@@ -42,7 +42,7 @@ Install the client dynamically by adding a dependency to the POM for your projec
4242
Install the client by adding the following dependency to the build file for your project:
4343

4444
```
45-
implementation "com.squareup:square:15.1.0.20210915"
45+
implementation "com.squareup:square:16.0.0.20211020"
4646
```
4747

4848
## API documentation
@@ -114,6 +114,16 @@ implementation "com.squareup:square:15.1.0.20210915"
114114
* [V1 Items]
115115
* [Transactions]
116116

117+
#### Usage Notes for V1 Transactions
118+
119+
The Square API supersedes the legacy Connect V1 APIs. Square strongly discourages using Connect V1 for most use cases. However, you must still use Connect V1 for listing settlements and listing payments. For more information, see [When to Use Connect V1](https://developer.squareup.com/docs/build-basics/using-connect-v1.html).
120+
121+
In the Square Java SDK, the [`V1TransactionsApi`](https://github.com/square/square-java-sdk/blob/master/doc/api/v1-transactions.md) class provides [`ListSettlements`](https://github.com/square/square-java-sdk/blob/master/doc/api/v1-transactions.md#list-settlements) and [`ListPayments`](https://github.com/square/square-java-sdk/blob/master/doc/api/v1-transactions.md#list-payments) for accessing these Connect V1 endpoints. However, Square has identified an issue that prevents these methods from returning results. There is no workaround for this issue.
122+
123+
If you need to use [List settlements](https://developer.squareup.com/reference/square/settlements-api/v1-list-settlements) or [List payments](https://developer.squareup.com/reference/square/settlements-api/v1-list-payments), you should send HTTP ```GET``` requests directly to these Connect V1 endpoints. The response body consists of a JSON list of objects, which you can process as needed.
124+
125+
You'll also need to provide logic to handle paginated results. For more information, see [Pagination in Connect V1](https://developer.squareup.com/docs/working-with-apis/pagination#pagination-in-connect-v1).
126+
117127
## Usage
118128

119129
First time using Square? Here’s how to get started:

doc/api/devices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ CompletableFuture<CreateDeviceCodeResponse> createDeviceCodeAsync(
8181

8282
```java
8383
DeviceCode bodyDeviceCode = new DeviceCode.Builder(
84-
"TERMINAL_API")
84+
null)
8585
.id("id0")
8686
.name("Counter 1")
8787
.code("code8")

doc/api/invoices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ InvoiceFilter bodyQueryFilter = new InvoiceFilter.Builder(
218218
.customerIds(bodyQueryFilterCustomerIds)
219219
.build();
220220
InvoiceSort bodyQuerySort = new InvoiceSort.Builder(
221-
"INVOICE_SORT_DATE")
221+
null)
222222
.order("DESC")
223223
.build();
224224
InvoiceQuery bodyQuery = new InvoiceQuery.Builder(

doc/api/payments.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ CompletableFuture<CreatePaymentResponse> createPaymentAsync(
111111

112112
```java
113113
Money bodyAmountMoney = new Money.Builder()
114-
.amount(200L)
114+
.amount(1000L)
115115
.currency("USD")
116116
.build();
117117
Money bodyTipMoney = new Money.Builder()
@@ -123,16 +123,16 @@ Money bodyAppFeeMoney = new Money.Builder()
123123
.currency("USD")
124124
.build();
125125
CreatePaymentRequest body = new CreatePaymentRequest.Builder(
126-
"ccof:uIbfJXhXETSP197M3GB",
127-
"4935a656-a929-4792-b97c-8848be85c27c",
126+
"ccof:GaJGNaZa8x4OgDJn4GB",
127+
"7b0f3ec5-086a-4871-8f13-3c81b3875218",
128128
bodyAmountMoney)
129129
.tipMoney(bodyTipMoney)
130130
.appFeeMoney(bodyAppFeeMoney)
131131
.delayDuration("delay_duration6")
132132
.autocomplete(true)
133133
.orderId("order_id0")
134-
.customerId("VDKXEEKPJN48QDG3BGGFAK05P8")
135-
.locationId("XK3DBG77NJBFX")
134+
.customerId("W92WH6P11H4Z77CTET0RNTGFW8")
135+
.locationId("L88917AVBK2S5")
136136
.referenceId("123456")
137137
.note("Brief description")
138138
.build();
@@ -255,7 +255,7 @@ Money bodyPaymentAmountMoney = new Money.Builder()
255255
.currency("USD")
256256
.build();
257257
Money bodyPaymentTipMoney = new Money.Builder()
258-
.amount(300L)
258+
.amount(100L)
259259
.currency("USD")
260260
.build();
261261
Payment bodyPayment = new Payment.Builder()
@@ -264,10 +264,10 @@ Payment bodyPayment = new Payment.Builder()
264264
.updatedAt("updated_at8")
265265
.amountMoney(bodyPaymentAmountMoney)
266266
.tipMoney(bodyPaymentTipMoney)
267-
.versionToken("Z3okDzm2VRv5m5nE3WGx381ItTNhvjkB4VapByyz54h6o")
267+
.versionToken("ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o")
268268
.build();
269269
UpdatePaymentRequest body = new UpdatePaymentRequest.Builder(
270-
"3d3c3b22-9572-4fc6-1111-e4d2f41b4122")
270+
"956f8b13-e4ec-45d6-85e8-d1d95ef0c5de")
271271
.payment(bodyPayment)
272272
.build();
273273

@@ -323,14 +323,16 @@ You can use this endpoint to complete a payment with the APPROVED `status`.
323323

324324
```java
325325
CompletableFuture<CompletePaymentResponse> completePaymentAsync(
326-
final String paymentId)
326+
final String paymentId,
327+
final CompletePaymentRequest body)
327328
```
328329

329330
## Parameters
330331

331332
| Parameter | Type | Tags | Description |
332333
| --- | --- | --- | --- |
333334
| `paymentId` | `String` | Template, Required | The unique ID identifying the payment to be completed. |
335+
| `body` | [`CompletePaymentRequest`](/doc/models/complete-payment-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
334336

335337
## Response Type
336338

@@ -340,8 +342,11 @@ CompletableFuture<CompletePaymentResponse> completePaymentAsync(
340342

341343
```java
342344
String paymentId = "payment_id0";
345+
CompletePaymentRequest body = new CompletePaymentRequest.Builder()
346+
.versionToken("version_token2")
347+
.build();
343348

344-
paymentsApi.completePaymentAsync(paymentId).thenAccept(result -> {
349+
paymentsApi.completePaymentAsync(paymentId, body).thenAccept(result -> {
345350
// TODO success callback handler
346351
}).exceptionally(exception -> {
347352
// TODO failure callback handler

doc/api/refunds.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,21 @@ CompletableFuture<RefundPaymentResponse> refundPaymentAsync(
100100

101101
```java
102102
Money bodyAmountMoney = new Money.Builder()
103-
.amount(100L)
103+
.amount(1000L)
104104
.currency("USD")
105105
.build();
106106
Money bodyAppFeeMoney = new Money.Builder()
107-
.amount(114L)
108-
.currency("GEL")
107+
.amount(10L)
108+
.currency("USD")
109109
.build();
110110
RefundPaymentRequest body = new RefundPaymentRequest.Builder(
111-
"a7e36d40-d24b-11e8-b568-0800200c9a66",
111+
"9b7f2dcf-49da-4411-b23e-a2d6af21333a",
112112
bodyAmountMoney,
113-
"UNOE3kv2BZwqHlJ830RCt5YCuaB")
113+
"R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY")
114114
.appFeeMoney(bodyAppFeeMoney)
115-
.reason("reason8")
115+
.reason("Example")
116+
.paymentVersionToken("payment_version_token6")
117+
.teamMemberId("team_member_id4")
116118
.build();
117119

118120
refundsApi.refundPaymentAsync(body).thenAccept(result -> {

doc/api/subscriptions.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,21 @@ Money bodyPriceOverrideMoney = new Money.Builder()
5050
.amount(100L)
5151
.currency("USD")
5252
.build();
53+
SubscriptionSource bodySource = new SubscriptionSource.Builder()
54+
.name("My App")
55+
.build();
5356
CreateSubscriptionRequest body = new CreateSubscriptionRequest.Builder(
5457
"S8GWD5R9QB376",
5558
"6JHXF3B2CW3YKHDV4XEM674H",
5659
"CHFGVKYY8RSV93M5KCYTG4PN0G")
5760
.idempotencyKey("8193148c-9586-11e6-99f9-28cfe92138cf")
58-
.startDate("2020-08-01")
61+
.startDate("2021-10-20")
5962
.canceledDate("canceled_date0")
6063
.taxPercentage("5")
6164
.priceOverrideMoney(bodyPriceOverrideMoney)
6265
.cardId("ccof:qy5x8hHGYsgLrp4Q4GB")
6366
.timezone("America/Los_Angeles")
67+
.source(bodySource)
6468
.build();
6569

6670
subscriptionsApi.createSubscriptionAsync(body).thenAccept(result -> {
@@ -113,9 +117,12 @@ List<String> bodyQueryFilterCustomerIds = new LinkedList<>();
113117
bodyQueryFilterCustomerIds.add("CHFGVKYY8RSV93M5KCYTG4PN0G");
114118
List<String> bodyQueryFilterLocationIds = new LinkedList<>();
115119
bodyQueryFilterLocationIds.add("S8GWD5R9QB376");
120+
List<String> bodyQueryFilterSourceNames = new LinkedList<>();
121+
bodyQueryFilterSourceNames.add("My App");
116122
SearchSubscriptionsFilter bodyQueryFilter = new SearchSubscriptionsFilter.Builder()
117123
.customerIds(bodyQueryFilterCustomerIds)
118124
.locationIds(bodyQueryFilterLocationIds)
125+
.sourceNames(bodyQueryFilterSourceNames)
119126
.build();
120127
SearchSubscriptionsQuery bodyQuery = new SearchSubscriptionsQuery.Builder()
121128
.filter(bodyQueryFilter)

0 commit comments

Comments
 (0)