Skip to content

Commit 30366bd

Browse files
author
Wolfgang Schuster
authored
Merge pull request #50 from square/release/12.0.0.20210616
Generated PR for Release: 12.0.0.20210616
2 parents fef7374 + cb34c37 commit 30366bd

File tree

284 files changed

+14675
-988
lines changed

Some content is hidden

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

284 files changed

+14675
-988
lines changed

CHANGELOG.md

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

3+
## Version 12.0.0.20210616 (2021-06-16)
4+
## New API releases
5+
* **Gift Cards API and Gift Card Activities API.** Gift card support is integrated in the [Square Seller Dashboard](https://squareup.com/dashboard/) and the [Square Point of Sale](https://squareup.com/us/en/point-of-sale) application. Sellers can sell, redeem, track, and reload Square gift cards. Now developers can use the [Gift Cards API](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api) and the [Gift Card Activities API](https://developer.squareup.com/reference/square_2021-06-16/gift-card-activities-api) to integrate Square gift cards into third-party applications. For more information, see [Gift Cards API Overview.](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api)
6+
7+
* **Cards API.** The [Cards API](https://developer.squareup.com/reference/square_2021-06-16/cards-api) replaces the deprecated `CreateCustomerCard` and `DeleteCustomerCard` endpoints and lets an application save a customer payment card on file along with other card management operations. For more information, see [Cards API Overview.](https://developer.squareup.com/docs/cards-api/overview)
8+
9+
## API updates
10+
* **Catalog API:**
11+
* [CatalogPricingRule](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogPricingRule). Support of the [customer group discount](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogPricingRule#definition__property-customer_group_ids_any) becomes GA. For more information, see [CreateCustomerGroupDiscounts.](https://developer.squareup.com/docs/catalog-api/configure-customer-group-discounts)
12+
* [CatalogItemVariation](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogItemVariation). Offers Beta support of the [stockable](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogItemVariation#definition__property-stockable) and [stockable_conversion](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogItemVariation#definition__property-stockable_conversion) attributes to enable sales of a product in multiple measurement units.
13+
* [UpsertCatalogObject](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/upsert-catalog-object) and [BatchUpsertCatalogObjects](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/batch-upsert-catalog-objects). Support creating an item with stockable and non-stockable variations with a specified stock conversion between the two. For more information, see [Enable Stock Conversion.](https://developer.squareup.com/docs/inventory-api/enable-stock-conversion)
14+
* [UpsertCatalogObject](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/upsert-catalog-object) and [BatchUpsertCatalogObjects](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/batch-upsert-catalog-objects). Require that an item be created with at least one variation. Otherwise, an `INVALID_REQUEST` error is returned.
15+
16+
* **Customers API:**
17+
* Using the Customers API to manage cards on file is deprecated:
18+
* The [CreateCustomerCard](https://developer.squareup.com/reference/square_2021-06-16/customers-api/create-customer-card) endpoint is deprecated and replaced by the [CreateCard](https://developer.squareup.com/reference/square_2021-06-16/cards-api/create-card) and [LinkCustomerToGiftCard](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api/link-customer-to-gift-card) endpoints.
19+
* The [DeleteCustomerCard](https://developer.squareup.com/reference/square_2021-06-16/customers-api/delete-customer-card) endpoint is deprecated and replaced by the [DisableCard](https://developer.squareup.com/reference/square_2021-06-16/cards-api/disable-card) and [UnlinkCustomerFromGiftCard](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api/unlink-customer-from-gift-card) endpoints.
20+
* The `cards` field in the [Customer](https://developer.squareup.com/reference/square_2021-06-16/objects/Customer) object is deprecated and replaced by the following endpoints:
21+
* [ListCards](https://developer.squareup.com/reference/square_2021-06-16/cards-api/list-cards) to retrieve credit and debit cards on file.
22+
* [ListGiftCards](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api/list-gift-cards) to retrieve gift cards on file.
23+
24+
For more information, see [Migrate to the Cards API and Gift Cards API.](https://developer.squareup.com/docs/customers-api/use-the-api/integrate-with-other-services#migrate-customer-cards)
25+
26+
* [Customer](https://developer.squareup.com/reference/square_2021-06-16/objects/Customer) object. In the `cards` field, the IDs for gift cards now have a `gftc:` prefix followed by the card number. This is a service-level change that applies to all Square API versions.
27+
28+
* **Disputes API:**
29+
* The Disputes API is now GA.
30+
* `RemoveDisputeEvidence`. Renamed to [DeleteDisputeEvidence](https://developer.squareup.com/reference/square_2021-06-16/objects/DeleteDisputeEvidence).
31+
* [CreateDisputeEvidenceFile.](https://developer.squareup.com/reference/square_2021-06-16/objects/CreateDisputeEvidenceFile) The URL is changed from `/v2/disputes/{dispute_id}/evidence_file` to `/v2/disputes/{dispute_id}/evidence-files`.
32+
* [CreateDisputeEvidenceText.](https://developer.squareup.com/reference/square_2021-06-16/objects/CreateDisputeEvidenceText) The URL is changed from `/v2/disputes/{dispute_id}/evidence_text` to `/v2/disputes/{dispute_id}/evidence-text`.
33+
* [ListDisputeEvidence.](https://developer.squareup.com/reference/square_2021-06-16/objects/ListDisputeEvidence) The endpoint now returns a pagination cursor and accepts a pagination cursor in requests.
34+
* `DISPUTES_READ` and `DISPUTES_WRITE` permissions are required for all Disputes API endpoints instead of `PAYMENTS_READ` and `PAYMENTS_WRITE`.
35+
* [DisputeEvidence.](https://developer.squareup.com/reference/square_2021-06-16/objects/DisputeEvidence) The `evidence_id` field is deprecated and replaced by the `id` field.
36+
* The `dispute.state.changed` webhook is renamed to `dispute.state.updated`.
37+
* [Dispute](https://developer.squareup.com/reference/square_2021-06-16/objects/Dispute) object. The following breaking changes are made:
38+
* The `dispute_id` field is deprecated and replaced by the `id` field.
39+
* The `reported_date` field is deprecated and replaced by the `reported_at` field.
40+
* The `evidence_ids` field is deprecated with no replacement.
41+
42+
For more information about the GA release of the Disputes API, see [Disputes Overview.](https://developer.squareup.com/docs/disputes-api/overview)
43+
44+
45+
* **Inventory API:**
46+
* [CatalogStockConversion](https://developer.squareup.com/docs/{SQUARE_TECH_REF}/objects/CatalogStockConversion) (Beta). Enables selling a product in multiple measurement units and lets Square sellers manage inventory counts of the product's stockable and a non-stockable variations in a self-consistent manner. For more information, see [Enable Stock Conversion.](https://developer.squareup.com/docs/inventory-api/enable-stock-conversion)
47+
48+
* **Invoices API:**
49+
* [CreateInvoice.](https://developer.squareup.com/reference/square_2021-06-16/invoices-api/create-invoice) The `location_id` field is now optional and defaults to the location ID of the associated order. If specified in the request, the value must match the location ID of the associated order. This is a service-level change that applies to all Square API versions.
50+
51+
* **Loyalty API:**
52+
* [LoyaltyProgramAccrualRule](https://developer.squareup.com/reference/square_2021-06-16/objects/LoyaltyProgramAccrualRule) object. New `excluded_category_ids` and `excluded_item_variation_ids` fields that represent any categories and items that are excluded from accruing points in spend-based loyalty programs.
53+
54+
* **Subscriptions API:**
55+
* [Subscription.](https://developer.squareup.com/reference/square_2021-06-16/objects/Subscription) The `paid_until_date` field is renamed to `charge_through_date`.
56+
* [UpdateSubscription.](https://developer.squareup.com/reference/square_2021-06-16/subscriptions-api/update-subscription) The `version` field is now optional because it can update only the latest version of a subscription.
57+
58+
* [CreateSubscription.](https://developer.squareup.com/reference/square_2021-06-16/subscriptions-api/create-subscription) The `idempotency_key` field is now optional in the request. If you do not provide it, each `CreateSubscription` assumes a unique (never used before) value and creates a subscription for each call.
59+
60+
## Documentation updates
61+
* [Order fee structure.](https://developer.squareup.com/docs/payments-pricing#orders-api-fee-structure) Documented the transaction fee related to using the Orders API with a non-Square payments provider.
62+
63+
364
## Version 11.0.0.20210513 (2021-05-13)
465
## New API releases
566

README.md

Lines changed: 2 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>11.0.0.20210513</version>
36+
<version>12.0.0.20210616</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:11.0.0.20210513"
45+
implementation "com.squareup:square:12.0.0.20210616"
4646
```
4747

4848
## API documentation

doc/api/cards.md

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# Cards
2+
3+
```java
4+
CardsApi cardsApi = client.getCardsApi();
5+
```
6+
7+
## Class Name
8+
9+
`CardsApi`
10+
11+
## Methods
12+
13+
* [List Cards](/doc/api/cards.md#list-cards)
14+
* [Create Card](/doc/api/cards.md#create-card)
15+
* [Retrieve Card](/doc/api/cards.md#retrieve-card)
16+
* [Disable Card](/doc/api/cards.md#disable-card)
17+
18+
19+
# List Cards
20+
21+
Retrieves a list of cards owned by the account making the request.
22+
A max of 25 cards will be returned.
23+
24+
```java
25+
CompletableFuture<ListCardsResponse> listCardsAsync(
26+
final String cursor,
27+
final String customerId,
28+
final Boolean includeDisabled,
29+
final String referenceId,
30+
final String sortOrder)
31+
```
32+
33+
## Parameters
34+
35+
| Parameter | Type | Tags | Description |
36+
| --- | --- | --- | --- |
37+
| `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>See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information. |
38+
| `customerId` | `String` | Query, Optional | Limit results to cards associated with the customer supplied.<br>By default, all cards owned by the merchant are returned. |
39+
| `includeDisabled` | `Boolean` | Query, Optional | Includes disabled cards.<br>By default, all enabled cards owned by the merchant are returned.<br>**Default**: `false` |
40+
| `referenceId` | `String` | Query, Optional | Limit results to cards associated with the reference_id supplied. |
41+
| `sortOrder` | [`String`](/doc/models/sort-order.md) | Query, Optional | Sorts the returned list by when the card was created with the specified order.<br>This field defaults to ASC. |
42+
43+
## Response Type
44+
45+
[`ListCardsResponse`](/doc/models/list-cards-response.md)
46+
47+
## Example Usage
48+
49+
```java
50+
String cursor = "cursor6";
51+
String customerId = "customer_id8";
52+
Boolean includeDisabled = false;
53+
String referenceId = "reference_id2";
54+
String sortOrder = "DESC";
55+
56+
cardsApi.listCardsAsync(cursor, customerId, includeDisabled, referenceId, sortOrder).thenAccept(result -> {
57+
// TODO success callback handler
58+
}).exceptionally(exception -> {
59+
// TODO failure callback handler
60+
return null;
61+
});
62+
```
63+
64+
65+
# Create Card
66+
67+
Adds a card on file to an existing merchant.
68+
69+
```java
70+
CompletableFuture<CreateCardResponse> createCardAsync(
71+
final CreateCardRequest body)
72+
```
73+
74+
## Parameters
75+
76+
| Parameter | Type | Tags | Description |
77+
| --- | --- | --- | --- |
78+
| `body` | [`CreateCardRequest`](/doc/models/create-card-request.md) | Body, Required | An object containing the fields to POST for the request.<br><br>See the corresponding object definition for field details. |
79+
80+
## Response Type
81+
82+
[`CreateCardResponse`](/doc/models/create-card-response.md)
83+
84+
## Example Usage
85+
86+
```java
87+
Address bodyCardBillingAddress = new Address.Builder()
88+
.addressLine1("500 Electric Ave")
89+
.addressLine2("Suite 600")
90+
.addressLine3("address_line_34")
91+
.locality("New York")
92+
.sublocality("sublocality8")
93+
.administrativeDistrictLevel1("NY")
94+
.postalCode("10003")
95+
.country("US")
96+
.build();
97+
Card bodyCard = new Card.Builder()
98+
.id("id0")
99+
.cardBrand("INTERAC")
100+
.last4("last_42")
101+
.expMonth(236L)
102+
.expYear(60L)
103+
.cardholderName("Amelia Earhart")
104+
.billingAddress(bodyCardBillingAddress)
105+
.customerId("VDKXEEKPJN48QDG3BGGFAK05P8")
106+
.referenceId("user-id-1")
107+
.build();
108+
CreateCardRequest body = new CreateCardRequest.Builder(
109+
"4935a656-a929-4792-b97c-8848be85c27c",
110+
"cnon:uIbfJXhXETSP197M3GB",
111+
bodyCard)
112+
.verificationToken("verification_token0")
113+
.build();
114+
115+
cardsApi.createCardAsync(body).thenAccept(result -> {
116+
// TODO success callback handler
117+
}).exceptionally(exception -> {
118+
// TODO failure callback handler
119+
return null;
120+
});
121+
```
122+
123+
124+
# Retrieve Card
125+
126+
Retrieves details for a specific Card.
127+
128+
```java
129+
CompletableFuture<RetrieveCardResponse> retrieveCardAsync(
130+
final String cardId)
131+
```
132+
133+
## Parameters
134+
135+
| Parameter | Type | Tags | Description |
136+
| --- | --- | --- | --- |
137+
| `cardId` | `String` | Template, Required | Unique ID for the desired Card. |
138+
139+
## Response Type
140+
141+
[`RetrieveCardResponse`](/doc/models/retrieve-card-response.md)
142+
143+
## Example Usage
144+
145+
```java
146+
String cardId = "card_id4";
147+
148+
cardsApi.retrieveCardAsync(cardId).thenAccept(result -> {
149+
// TODO success callback handler
150+
}).exceptionally(exception -> {
151+
// TODO failure callback handler
152+
return null;
153+
});
154+
```
155+
156+
157+
# Disable Card
158+
159+
Disables the card, preventing any further updates or charges.
160+
Disabling an already disabled card is allowed but has no effect.
161+
162+
```java
163+
CompletableFuture<DisableCardResponse> disableCardAsync(
164+
final String cardId)
165+
```
166+
167+
## Parameters
168+
169+
| Parameter | Type | Tags | Description |
170+
| --- | --- | --- | --- |
171+
| `cardId` | `String` | Template, Required | Unique ID for the desired Card. |
172+
173+
## Response Type
174+
175+
[`DisableCardResponse`](/doc/models/disable-card-response.md)
176+
177+
## Example Usage
178+
179+
```java
180+
String cardId = "card_id4";
181+
182+
cardsApi.disableCardAsync(cardId).thenAccept(result -> {
183+
// TODO success callback handler
184+
}).exceptionally(exception -> {
185+
// TODO failure callback handler
186+
return null;
187+
});
188+
```
189+

0 commit comments

Comments
 (0)