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

Commit

Permalink
Release/2.4.0 (#25)
Browse files Browse the repository at this point in the history
* From connect-api-specification: Release SDK 2.4 (#81)

* Document changes for 2.4 release
  • Loading branch information
Francisco Rojas authored Sep 27, 2017
1 parent 484b515 commit c1d270d
Show file tree
Hide file tree
Showing 20 changed files with 681 additions and 21 deletions.
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## Version 2.4 (2017-09-27)

### New features: Register Domain for Apple Pay

* `RegisterDomain` endpoint activates a domain for use with Web Apple Pay.

### Other Changes

* `Location.type` used to indicate whether or not the location object represents a physical space.

## Version 2.3.1 (2017-09-15)

### New features: Charge Orders
Expand Down
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Add this dependency to your project's POM:
<dependency>
<groupId>com.squareup</groupId>
<artifactId>connect</artifactId>
<version>2.3.1</version>
<version>2.4.0</version>
<scope>compile</scope>
</dependency>
```
Expand All @@ -28,7 +28,7 @@ Add this dependency to your project's POM:
Add this dependency to your project's build file:

```groovy
compile "com.squareup:connect:2.3.1"
compile "com.squareup:connect:2.4.0"
```

### Build and Install locally
Expand All @@ -47,7 +47,7 @@ At first generate the JAR by executing:

Then manually install the following JARs:

* target/connect-2.3.1.jar
* target/connect-2.4.0.jar
* target/lib/*.jar

## Getting Started
Expand All @@ -59,12 +59,12 @@ Please follow the [installation](#installation) instruction and execute the foll
import com.squareup.connect.*;
import com.squareup.connect.auth.*;
import com.squareup.connect.models.*;
import com.squareup.connect.api.CatalogApi;
import com.squareup.connect.api.ApplePayApi;

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

public class CatalogApiExample {
public class ApplePayApiExample {

public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
Expand All @@ -73,13 +73,13 @@ public class CatalogApiExample {
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

CatalogApi apiInstance = new CatalogApi();
BatchDeleteCatalogObjectsRequest body = new BatchDeleteCatalogObjectsRequest(); // BatchDeleteCatalogObjectsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
ApplePayApi apiInstance = new ApplePayApi();
RegisterDomainRequest body = new RegisterDomainRequest(); // RegisterDomainRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
BatchDeleteCatalogObjectsResponse result = apiInstance.batchDeleteCatalogObjects(body);
RegisterDomainResponse result = apiInstance.registerDomain(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling CatalogApi#batchDeleteCatalogObjects");
System.err.println("Exception when calling ApplePayApi#registerDomain");
e.printStackTrace();
}
}
Expand All @@ -93,6 +93,7 @@ All URIs are relative to *https://connect.squareup.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ApplePayApi* | [**registerDomain**](docs/ApplePayApi.md#registerDomain) | **POST** /v2/apple-pay/domains | RegisterDomain
*CatalogApi* | [**batchDeleteCatalogObjects**](docs/CatalogApi.md#batchDeleteCatalogObjects) | **POST** /v2/catalog/batch-delete | BatchDeleteCatalogObjects
*CatalogApi* | [**batchRetrieveCatalogObjects**](docs/CatalogApi.md#batchRetrieveCatalogObjects) | **POST** /v2/catalog/batch-retrieve | BatchRetrieveCatalogObjects
*CatalogApi* | [**batchUpsertCatalogObjects**](docs/CatalogApi.md#batchUpsertCatalogObjects) | **POST** /v2/catalog/batch-upsert | BatchUpsertCatalogObjects
Expand Down Expand Up @@ -284,6 +285,7 @@ Class | Method | HTTP request | Description
- [Location](docs/Location.md)
- [LocationCapability](docs/LocationCapability.md)
- [LocationStatus](docs/LocationStatus.md)
- [LocationType](docs/LocationType.md)
- [Money](docs/Money.md)
- [Order](docs/Order.md)
- [OrderLineItem](docs/OrderLineItem.md)
Expand All @@ -295,6 +297,9 @@ Class | Method | HTTP request | Description
- [OrderLineItemTaxType](docs/OrderLineItemTaxType.md)
- [Refund](docs/Refund.md)
- [RefundStatus](docs/RefundStatus.md)
- [RegisterDomainRequest](docs/RegisterDomainRequest.md)
- [RegisterDomainResponse](docs/RegisterDomainResponse.md)
- [RegisterDomainResponseStatus](docs/RegisterDomainResponseStatus.md)
- [RetrieveCatalogObjectRequest](docs/RetrieveCatalogObjectRequest.md)
- [RetrieveCatalogObjectResponse](docs/RetrieveCatalogObjectResponse.md)
- [RetrieveCustomerRequest](docs/RetrieveCustomerRequest.md)
Expand Down
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.3.1'
version = '2.4.0'

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

All URIs are relative to *https://connect.squareup.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**registerDomain**](ApplePayApi.md#registerDomain) | **POST** /v2/apple-pay/domains | RegisterDomain


<a name="registerDomain"></a>
# **registerDomain**
> RegisterDomainResponse registerDomain(body)
RegisterDomain

Activates a domain for use with Web Apple Pay and Square. A validation will be performed on this domain by Apple to ensure is it properly set up as an Apple Pay enabled domain. This endpoint provides an easy way for platform developers to bulk activate Web Apple Pay with Square for merchants using their platform. To learn more about Apple Pay on Web see the Apple Pay section in the [Embedding the Square Payment Form](https://docs.connect.squareup.com/articles/adding-payment-form) guide.

### Example
```java
// Import classes:
//import com.squareup.connect.ApiClient;
//import com.squareup.connect.ApiException;
//import com.squareup.connect.Configuration;
//import com.squareup.connect.auth.*;
//import com.squareup.connect.api.ApplePayApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure OAuth2 access token for authorization: oauth2
OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
oauth2.setAccessToken("YOUR ACCESS TOKEN");

ApplePayApi apiInstance = new ApplePayApi();
RegisterDomainRequest body = new RegisterDomainRequest(); // RegisterDomainRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details.
try {
RegisterDomainResponse result = apiInstance.registerDomain(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ApplePayApi#registerDomain");
e.printStackTrace();
}
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**RegisterDomainRequest**](RegisterDomainRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. |

### Return type

[**RegisterDomainResponse**](RegisterDomainResponse.md)

### Authorization

[oauth2](../README.md#oauth2)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

2 changes: 1 addition & 1 deletion docs/CatalogObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name | Type | Description | Notes
**version** | **Long** | The version of the object. When updating an object, the version supplied by the must match the version in the database, otherwise the write will be rejected as conflicting. | [optional]
**isDeleted** | **Boolean** | If &#x60;true&#x60;, the object has been deleted from the database. Must be &#x60;false&#x60; for new objects being inserted. When deleted, the &#x60;updated_at&#x60; field will equal the deletion time. | [optional]
**catalogV1Ids** | [**List&lt;CatalogV1Id&gt;**](CatalogV1Id.md) | The Connect V1 IDs for this object at each [location](#type-location) where it is present, where they differ from the object&#39;s Connect V2 ID. The field will only be present for objects that have been created or modified by legacy APIs. | [optional]
**presentAtAllLocations** | **Boolean** | If &#x60;true&#x60;, this object is present at all locations (including future locations), except where specified in the &#x60;absent_at_location_ids&#x60; field. If &#x60;false&#x60;, this object is not present at any locations (including future locations), except where specified in the &#x60;present_at_location_ids&#x60; field. | [optional]
**presentAtAllLocations** | **Boolean** | If &#x60;true&#x60;, this object is present at all locations (including future locations), except where specified in the &#x60;absent_at_location_ids&#x60; field. If &#x60;false&#x60;, this object is not present at any locations (including future locations), except where specified in the &#x60;present_at_location_ids&#x60; field. If not specified, defaults to &#x60;true&#x60;. | [optional]
**presentAtLocationIds** | **List&lt;String&gt;** | A list of locations where the object is present, even if &#x60;present_at_all_locations&#x60; is &#x60;false&#x60;. | [optional]
**absentAtLocationIds** | **List&lt;String&gt;** | A list of locations where the object is not present, even if &#x60;present_at_all_locations&#x60; is &#x60;true&#x60;. | [optional]
**itemData** | [**CatalogItem**](CatalogItem.md) | Structured data for a [CatalogItem](#type-catalogitem), set for CatalogObjects of type &#x60;ITEM&#x60;. | [optional]
Expand Down
11 changes: 10 additions & 1 deletion docs/Location.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | The location&#39;s unique ID. | [optional]
**name** | **String** | The location&#39;s name. Location names are set by the location owner and displayed in the dashboard as the location&#39;s nickname | [optional]
**name** | **String** | The location&#39;s name. Location names are set by the account owner and displayed in the dashboard as the location&#39;s nickname | [optional]
**address** | [**Address**](Address.md) | The location&#39;s physical address. | [optional]
**timezone** | **String** | The [IANA Timezone Database](https://www.iana.org/time-zones) identifier for the location&#39;s timezone. | [optional]
**capabilities** | [**List&lt;CapabilitiesEnum&gt;**](#List&lt;CapabilitiesEnum&gt;) | Indicates which Square features are enabled for the location. See [LocationCapability](#type-locationcapability) for possible values. | [optional]
Expand All @@ -17,6 +17,7 @@ Name | Type | Description | Notes
**currency** | [**CurrencyEnum**](#CurrencyEnum) | The currency used for all transactions at this location, specified in __ISO 4217 format__. For example, the currency for a location processing transactions in the United States is &#39;USD&#39;. See [Currency](#type-currency) for possible values. | [optional]
**phoneNumber** | **String** | The location&#39;s phone_number. | [optional]
**businessName** | **String** | The location&#39;s business_name which is shown to its customers. For example, this is the name printed on its customer&#39;s receipts. | [optional]
**type** | [**TypeEnum**](#TypeEnum) | The location&#39;s type, as set by the account owner in the Square dashboard. Typically used to indicate whether or not the location object represents a physical space like a building or mall space. See [LocationType](#type-locationtype) for possible values. | [optional]


<a name="List<CapabilitiesEnum>"></a>
Expand Down Expand Up @@ -477,4 +478,12 @@ ZMW | &quot;ZMW&quot;
BTC | &quot;BTC&quot;


<a name="TypeEnum"></a>
## Enum: TypeEnum
Name | Value
---- | -----
PHYSICAL | &quot;PHYSICAL&quot;
MOBILE | &quot;MOBILE&quot;



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

# LocationType

## Enum


* `PHYSICAL` (value: `"PHYSICAL"`)

* `MOBILE` (value: `"MOBILE"`)



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

# RegisterDomainRequest

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**domainName** | **String** | A domain name as described in RFC-1034 that will be registered with ApplePay |



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

# RegisterDomainResponse

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**errors** | [**List&lt;Error&gt;**](Error.md) | Any errors that occurred during the request. | [optional]
**status** | [**StatusEnum**](#StatusEnum) | Status of the domain registration. See [RegisterDomainResponseStatus](#type-registerdomainresponsestatus) for possible values. | [optional]


<a name="StatusEnum"></a>
## Enum: StatusEnum
Name | Value
---- | -----
PENDING | &quot;PENDING&quot;
VERIFIED | &quot;VERIFIED&quot;



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

# RegisterDomainResponseStatus

## Enum


* `PENDING` (value: `"PENDING"`)

* `VERIFIED` (value: `"VERIFIED"`)



2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>connect</artifactId>
<packaging>jar</packaging>
<name>connect</name>
<version>2.3.1</version>
<version>2.4.0</version>
<url>https://github.com/square/connect-java-sdk/</url>
<description>Java client library for the Square Connect API</description>
<scm>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/squareup/connect/ApiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public ApiClient() {
this.dateFormat = new RFC3339DateFormat();

// Set default User-Agent.
setUserAgent("Square-Connect-Java/2.3.1");
setUserAgent("Square-Connect-Java/2.4.0");

// Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();
Expand Down
Loading

0 comments on commit c1d270d

Please sign in to comment.