Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Release/2.20190814.0 #74

Merged
merged 2 commits into from
Aug 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Change Log

## Version 2.20190814.0 (2019-08-15)

* **New functionality**: All SDKs have been updated to support the Sandbox v2 BETA release
* **Deprecated functionality**: All Transactions API functionality is deprecated in favor of Payments API and Refunds API functionality.
* **New functionality**: All SDKs have been updated to support the Payments API GA.
* **New functionality**: All SDKs have been updated to support the Refunds API GA.
* **New functionality**: All SDKs have been updated to support Orders API updates:
* Pickup Fulfillments, SearchOrders, and ServiceCharges move from BETA to GA.
* New BETA endpoint: Orders.UpdateOrder — use the UpdateOrder endpoint to update existing orders.
* New BETA functionality: Create shipment-type fulfillments.
* **New functionality**: Locations.RetrieveLocation — use the RetrieveLocation endpoint to load details for a specific Location.

## Version 2.20190724.0 (2019-07-24)

* **BETA releases**:
Expand Down
98 changes: 93 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Square Connect Java SDK [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.squareup/connect/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.squareup/connect)
![Square logo]

# Square Connect Java SDK

---

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.squareup/connect/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.squareup/connect)
[![Apache-2 license](https://img.shields.io/badge/license-Apache2-brightgreen.svg)](https://www.apache.org/licenses/LICENSE-2.0)
==================

**If you have feedback about the new SDKs, or just want to talk to other Square Developers, request an invite to the new [slack community for Square Developers](https://squ.re/2GB8GHk)**

## ENUM to String Migration
The Java SDK no longer treats enums as explicit types. Instead, all enums are handled as static strings.
The Java SDK no longer treats enums as explicit types. Instead, all enums are handled as static strings.
Previously, you would use an enum constant to represent the related string value. For example:
```java
Money money = new Money();
Expand Down Expand Up @@ -39,7 +47,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.squareup</groupId>
<artifactId>connect</artifactId>
<version>2.20190724.0</version>
<version>2.20190814.0</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -49,7 +57,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "com.squareup:connect:2.20190724.0"
compile "com.squareup:connect:2.20190814.0"
```

### Option 3: Build and Install locally
Expand Down Expand Up @@ -91,7 +99,7 @@ At first generate the JAR by executing:

Then manually install the following JARs:

* target/connect-2.20190724.0.jar
* target/connect-2.20190814.0.jar
* target/lib/*.jar

## Getting Started
Expand Down Expand Up @@ -133,6 +141,36 @@ public class Example {
}
```

### How to configure sandbox environment
```java

import com.squareup.connect.ApiClient;
import com.squareup.connect.ApiException;
import com.squareup.connect.Configuration;
import com.squareup.connect.api.LocationsApi;
import com.squareup.connect.auth.OAuth;
import com.squareup.connect.models.Location;

import java.io.File;
import java.util.*;

public class Example {

public static void main(String[] args) {
ApiClient apiClient = Configuration.getDefaultApiClient();
// Set sandbox url
apiClient.setBasePath('https://connect.squareupsandbox.com');

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) apiClient.getAuthentication("oauth2");
// Set your sandbox token
oauth2.setAccessToken("YOUR_SANDBOX_ACCESS_TOKEN");

LocationsApi locationsApi = new LocationsApi();
}
}
```

## Documentation for API Endpoints

All URIs are relative to *https://connect.squareup.com*
Expand Down Expand Up @@ -190,7 +228,18 @@ Class | Method | HTTP request | Description
*OAuthApi* | [**revokeToken**](docs/OAuthApi.md#revokeToken) | **POST** /oauth2/revoke | RevokeToken
*OrdersApi* | [**batchRetrieveOrders**](docs/OrdersApi.md#batchRetrieveOrders) | **POST** /v2/locations/{location_id}/orders/batch-retrieve | BatchRetrieveOrders
*OrdersApi* | [**createOrder**](docs/OrdersApi.md#createOrder) | **POST** /v2/locations/{location_id}/orders | CreateOrder
*OrdersApi* | [**payOrder**](docs/OrdersApi.md#payOrder) | **POST** /v2/orders/{order_id}/pay | PayOrder
*OrdersApi* | [**searchOrders**](docs/OrdersApi.md#searchOrders) | **POST** /v2/orders/search | SearchOrders
*OrdersApi* | [**updateOrder**](docs/OrdersApi.md#updateOrder) | **PUT** /v2/locations/{location_id}/orders/{order_id} | UpdateOrder
*PaymentsApi* | [**cancelPayment**](docs/PaymentsApi.md#cancelPayment) | **POST** /v2/payments/{payment_id}/cancel | CancelPayment
*PaymentsApi* | [**cancelPaymentByIdempotencyKey**](docs/PaymentsApi.md#cancelPaymentByIdempotencyKey) | **POST** /v2/payments/cancel | CancelPaymentByIdempotencyKey
*PaymentsApi* | [**completePayment**](docs/PaymentsApi.md#completePayment) | **POST** /v2/payments/{payment_id}/complete | CompletePayment
*PaymentsApi* | [**createPayment**](docs/PaymentsApi.md#createPayment) | **POST** /v2/payments | CreatePayment
*PaymentsApi* | [**getPayment**](docs/PaymentsApi.md#getPayment) | **GET** /v2/payments/{payment_id} | GetPayment
*PaymentsApi* | [**listPayments**](docs/PaymentsApi.md#listPayments) | **GET** /v2/payments | ListPayments
*RefundsApi* | [**getPaymentRefund**](docs/RefundsApi.md#getPaymentRefund) | **GET** /v2/refunds/{refund_id} | GetPaymentRefund
*RefundsApi* | [**listPaymentRefunds**](docs/RefundsApi.md#listPaymentRefunds) | **GET** /v2/refunds | ListPaymentRefunds
*RefundsApi* | [**refundPayment**](docs/RefundsApi.md#refundPayment) | **POST** /v2/refunds | RefundPayment
*ReportingApi* | [**listAdditionalRecipientReceivableRefunds**](docs/ReportingApi.md#listAdditionalRecipientReceivableRefunds) | **GET** /v2/locations/{location_id}/additional-recipient-receivable-refunds | ListAdditionalRecipientReceivableRefunds
*ReportingApi* | [**listAdditionalRecipientReceivables**](docs/ReportingApi.md#listAdditionalRecipientReceivables) | **GET** /v2/locations/{location_id}/additional-recipient-receivables | ListAdditionalRecipientReceivables
*TransactionsApi* | [**captureTransaction**](docs/TransactionsApi.md#captureTransaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/capture | CaptureTransaction
Expand Down Expand Up @@ -277,6 +326,7 @@ Class | Method | HTTP request | Description
- [AdditionalRecipientReceivable](docs/AdditionalRecipientReceivable.md)
- [AdditionalRecipientReceivableRefund](docs/AdditionalRecipientReceivableRefund.md)
- [Address](docs/Address.md)
- [BalancePaymentDetails](docs/BalancePaymentDetails.md)
- [BatchChangeInventoryRequest](docs/BatchChangeInventoryRequest.md)
- [BatchChangeInventoryResponse](docs/BatchChangeInventoryResponse.md)
- [BatchDeleteCatalogObjectsRequest](docs/BatchDeleteCatalogObjectsRequest.md)
Expand All @@ -294,10 +344,15 @@ Class | Method | HTTP request | Description
- [BreakType](docs/BreakType.md)
- [BusinessHours](docs/BusinessHours.md)
- [BusinessHoursPeriod](docs/BusinessHoursPeriod.md)
- [CancelPaymentByIdempotencyKeyRequest](docs/CancelPaymentByIdempotencyKeyRequest.md)
- [CancelPaymentByIdempotencyKeyResponse](docs/CancelPaymentByIdempotencyKeyResponse.md)
- [CancelPaymentRequest](docs/CancelPaymentRequest.md)
- [CancelPaymentResponse](docs/CancelPaymentResponse.md)
- [CaptureTransactionRequest](docs/CaptureTransactionRequest.md)
- [CaptureTransactionResponse](docs/CaptureTransactionResponse.md)
- [Card](docs/Card.md)
- [CardBrand](docs/CardBrand.md)
- [CardPaymentDetails](docs/CardPaymentDetails.md)
- [CatalogCategory](docs/CatalogCategory.md)
- [CatalogDiscount](docs/CatalogDiscount.md)
- [CatalogDiscountType](docs/CatalogDiscountType.md)
Expand Down Expand Up @@ -342,6 +397,8 @@ Class | Method | HTTP request | Description
- [ChargeRequestAdditionalRecipient](docs/ChargeRequestAdditionalRecipient.md)
- [ChargeResponse](docs/ChargeResponse.md)
- [Checkout](docs/Checkout.md)
- [CompletePaymentRequest](docs/CompletePaymentRequest.md)
- [CompletePaymentResponse](docs/CompletePaymentResponse.md)
- [Coordinates](docs/Coordinates.md)
- [Country](docs/Country.md)
- [CreateBreakTypeRequest](docs/CreateBreakTypeRequest.md)
Expand All @@ -360,6 +417,8 @@ Class | Method | HTTP request | Description
- [CreateOrderRequestModifier](docs/CreateOrderRequestModifier.md)
- [CreateOrderRequestTax](docs/CreateOrderRequestTax.md)
- [CreateOrderResponse](docs/CreateOrderResponse.md)
- [CreatePaymentRequest](docs/CreatePaymentRequest.md)
- [CreatePaymentResponse](docs/CreatePaymentResponse.md)
- [CreateRefundRequest](docs/CreateRefundRequest.md)
- [CreateRefundResponse](docs/CreateRefundResponse.md)
- [CreateShiftRequest](docs/CreateShiftRequest.md)
Expand Down Expand Up @@ -398,6 +457,10 @@ Class | Method | HTTP request | Description
- [GetBreakTypeResponse](docs/GetBreakTypeResponse.md)
- [GetEmployeeWageRequest](docs/GetEmployeeWageRequest.md)
- [GetEmployeeWageResponse](docs/GetEmployeeWageResponse.md)
- [GetPaymentRefundRequest](docs/GetPaymentRefundRequest.md)
- [GetPaymentRefundResponse](docs/GetPaymentRefundResponse.md)
- [GetPaymentRequest](docs/GetPaymentRequest.md)
- [GetPaymentResponse](docs/GetPaymentResponse.md)
- [GetShiftRequest](docs/GetShiftRequest.md)
- [GetShiftResponse](docs/GetShiftResponse.md)
- [InventoryAdjustment](docs/InventoryAdjustment.md)
Expand Down Expand Up @@ -425,6 +488,10 @@ Class | Method | HTTP request | Description
- [ListEmployeesResponse](docs/ListEmployeesResponse.md)
- [ListLocationsRequest](docs/ListLocationsRequest.md)
- [ListLocationsResponse](docs/ListLocationsResponse.md)
- [ListPaymentRefundsRequest](docs/ListPaymentRefundsRequest.md)
- [ListPaymentRefundsResponse](docs/ListPaymentRefundsResponse.md)
- [ListPaymentsRequest](docs/ListPaymentsRequest.md)
- [ListPaymentsResponse](docs/ListPaymentsResponse.md)
- [ListRefundsRequest](docs/ListRefundsRequest.md)
- [ListRefundsResponse](docs/ListRefundsResponse.md)
- [ListTransactionsRequest](docs/ListTransactionsRequest.md)
Expand All @@ -440,6 +507,8 @@ Class | Method | HTTP request | Description
- [MeasurementUnitCustom](docs/MeasurementUnitCustom.md)
- [MeasurementUnitGeneric](docs/MeasurementUnitGeneric.md)
- [MeasurementUnitLength](docs/MeasurementUnitLength.md)
- [MeasurementUnitTime](docs/MeasurementUnitTime.md)
- [MeasurementUnitUnitType](docs/MeasurementUnitUnitType.md)
- [MeasurementUnitVolume](docs/MeasurementUnitVolume.md)
- [MeasurementUnitWeight](docs/MeasurementUnitWeight.md)
- [ModelBreak](docs/ModelBreak.md)
Expand All @@ -452,9 +521,12 @@ Class | Method | HTTP request | Description
- [OrderFulfillmentPickupDetails](docs/OrderFulfillmentPickupDetails.md)
- [OrderFulfillmentPickupDetailsScheduleType](docs/OrderFulfillmentPickupDetailsScheduleType.md)
- [OrderFulfillmentRecipient](docs/OrderFulfillmentRecipient.md)
- [OrderFulfillmentShipmentDetails](docs/OrderFulfillmentShipmentDetails.md)
- [OrderFulfillmentState](docs/OrderFulfillmentState.md)
- [OrderFulfillmentType](docs/OrderFulfillmentType.md)
- [OrderLineItem](docs/OrderLineItem.md)
- [OrderLineItemAppliedDiscount](docs/OrderLineItemAppliedDiscount.md)
- [OrderLineItemAppliedTax](docs/OrderLineItemAppliedTax.md)
- [OrderLineItemDiscount](docs/OrderLineItemDiscount.md)
- [OrderLineItemDiscountScope](docs/OrderLineItemDiscountScope.md)
- [OrderLineItemDiscountType](docs/OrderLineItemDiscountType.md)
Expand All @@ -475,8 +547,15 @@ Class | Method | HTTP request | Description
- [OrderServiceChargeCalculationPhase](docs/OrderServiceChargeCalculationPhase.md)
- [OrderSource](docs/OrderSource.md)
- [OrderState](docs/OrderState.md)
- [PayOrderRequest](docs/PayOrderRequest.md)
- [PayOrderResponse](docs/PayOrderResponse.md)
- [Payment](docs/Payment.md)
- [PaymentRefund](docs/PaymentRefund.md)
- [ProcessingFee](docs/ProcessingFee.md)
- [Product](docs/Product.md)
- [Refund](docs/Refund.md)
- [RefundPaymentRequest](docs/RefundPaymentRequest.md)
- [RefundPaymentResponse](docs/RefundPaymentResponse.md)
- [RefundStatus](docs/RefundStatus.md)
- [RegisterDomainRequest](docs/RegisterDomainRequest.md)
- [RegisterDomainResponse](docs/RegisterDomainResponse.md)
Expand All @@ -497,6 +576,8 @@ Class | Method | HTTP request | Description
- [RetrieveInventoryCountResponse](docs/RetrieveInventoryCountResponse.md)
- [RetrieveInventoryPhysicalCountRequest](docs/RetrieveInventoryPhysicalCountRequest.md)
- [RetrieveInventoryPhysicalCountResponse](docs/RetrieveInventoryPhysicalCountResponse.md)
- [RetrieveLocationRequest](docs/RetrieveLocationRequest.md)
- [RetrieveLocationResponse](docs/RetrieveLocationResponse.md)
- [RetrieveTransactionRequest](docs/RetrieveTransactionRequest.md)
- [RetrieveTransactionResponse](docs/RetrieveTransactionResponse.md)
- [RevokeTokenRequest](docs/RevokeTokenRequest.md)
Expand Down Expand Up @@ -551,6 +632,8 @@ Class | Method | HTTP request | Description
- [UpdateItemModifierListsResponse](docs/UpdateItemModifierListsResponse.md)
- [UpdateItemTaxesRequest](docs/UpdateItemTaxesRequest.md)
- [UpdateItemTaxesResponse](docs/UpdateItemTaxesResponse.md)
- [UpdateOrderRequest](docs/UpdateOrderRequest.md)
- [UpdateOrderResponse](docs/UpdateOrderResponse.md)
- [UpdateShiftRequest](docs/UpdateShiftRequest.md)
- [UpdateShiftResponse](docs/UpdateShiftResponse.md)
- [UpdateWorkweekConfigRequest](docs/UpdateWorkweekConfigRequest.md)
Expand Down Expand Up @@ -819,3 +902,8 @@ It's recommended to create an instance of `ApiClient` per thread in a multithrea

[email protected]




[//]: # "Link anchor definitions"
[Square Logo]: https://docs.connect.squareup.com/images/github/github-square-logo.svg
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'idea'
apply plugin: 'eclipse'

group = 'com.squareup'
version = '2.20190724.0'
version = '2.20190814.0'

buildscript {
repositories {
Expand Down
15 changes: 15 additions & 0 deletions docs/BalancePaymentDetails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# BalancePaymentDetails

### Description

Reflects the current status of a balance payment.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**accountId** | **String** | ID for the account used to fund the payment. | [optional]
**status** | **String** | The balance payment’s current state. Can be &#x60;COMPLETED&#x60; or &#x60;FAILED&#x60;. | [optional]



1 change: 0 additions & 1 deletion docs/BatchRetrieveOrdersResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**orders** | [**List&lt;Order&gt;**](Order.md) | The requested orders. This will omit any requested orders that do not exist or are not charged. | [optional]
**errors** | [**List&lt;Error&gt;**](Error.md) | Any errors that occurred during the request. | [optional]
**unconvertibleTransactionIds** | **List&lt;String&gt;** | List of transaction ids within the requested set of ids that encountered transformation issues when being converted to an Order. | [optional]



14 changes: 14 additions & 0 deletions docs/CancelPaymentByIdempotencyKeyRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# CancelPaymentByIdempotencyKeyRequest

### Description

Specifies idempotency key of a payment to cancel.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**idempotencyKey** | **String** | &#x60;idempotency_key&#x60; identifying the payment to be canceled. |



14 changes: 14 additions & 0 deletions docs/CancelPaymentByIdempotencyKeyResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

# CancelPaymentByIdempotencyKeyResponse

### Description

Return value from the [CancelPaymentByIdempotencyKey](#endpoint-payments-cancelpaymentbyidempotencykey) endpoint. On success, `errors` will be empty.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**errors** | [**List&lt;Error&gt;**](Error.md) | Any errors that occurred during the request. | [optional]



13 changes: 13 additions & 0 deletions docs/CancelPaymentRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# CancelPaymentRequest

### Description

Cancels a payment before it has been completed. Note: only payments created with `autocomplete` set to false can be canceled.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------



15 changes: 15 additions & 0 deletions docs/CancelPaymentResponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# CancelPaymentResponse

### Description

Return value from the [CancelPayment](#endpoint-payments-cancelpayment) endpoint.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**errors** | [**List&lt;Error&gt;**](Error.md) | Information on errors encountered during the request. | [optional]
**payment** | [**Payment**](Payment.md) | The successfully canceled &#x60;Payment&#x60; object. | [optional]



2 changes: 1 addition & 1 deletion docs/CaptureTransactionResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

### Description

Defines the fields that are included in the response body of a request to the CaptureTransaction endpoint.
Defines the fields that are included in the response body of a request to the [CaptureTransaction](#endpoint-capturetransaction) endpoint.

## Properties
Name | Type | Description | Notes
Expand Down
23 changes: 23 additions & 0 deletions docs/CardPaymentDetails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

# CardPaymentDetails

### Description

Reflects the current status of a card payment.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**status** | **String** | The card payment&#39;s current state. It can be one of: &#x60;AUTHORIZED&#x60;, &#x60;CAPTURED&#x60;, &#x60;VOIDED&#x60;, &#x60;FAILED&#x60;. | [optional]
**card** | [**Card**](Card.md) | The credit card&#39;s non-confidential details. | [optional]
**entryMethod** | **String** | The method used to enter the card&#39;s details for the payment. Can be &#x60;KEYED&#x60;, &#x60;SWIPED&#x60;, &#x60;EMV&#x60;, &#x60;ON_FILE&#x60;, or &#x60;CONTACTLESS&#x60;. | [optional]
**cvvStatus** | **String** | Status code returned from the Card Verification Value (CVV) check. | [optional]
**avsStatus** | **String** | Status code returned from the Address Verification System (AVS) check. | [optional]
**authResultCode** | **String** | Status code returned by the card issuer that describes the payment&#39;s authorization status. | [optional]
**applicationIdentifier** | **String** | For EMV payments, identifies the EMV application used for the payment | [optional]
**applicationName** | **String** | For EMV payments, the human-readable name of the EMV application used for the payment. | [optional]
**applicationCryptogram** | **String** | For EMV payments, the cryptogram generated for the payment. | [optional]
**errors** | [**List&lt;Error&gt;**](Error.md) | Information on errors encountered during the request. | [optional]



2 changes: 1 addition & 1 deletion docs/ChargeRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

### Description

Defines the parameters that can be included in the body of a request to the Charge endpoint.
Defines the parameters that can be included in the body of a request to the [Charge](#endpoint-charge) endpoint. Deprecated - recommend using [CreatePayment](#endpoint-payments-createpayment)

## Properties
Name | Type | Description | Notes
Expand Down
2 changes: 1 addition & 1 deletion docs/ChargeResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

### Description

Defines the fields that are included in the response body of a request to the Charge endpoint. One of `errors` or `transaction` is present in a given response (never both).
Defines the fields that are included in the response body of a request to the [Charge](#endpoint-charge) endpoint. One of `errors` or `transaction` is present in a given response (never both).

## Properties
Name | Type | Description | Notes
Expand Down
Loading