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

Commit

Permalink
Release/2.3.1 (#24)
Browse files Browse the repository at this point in the history
* From connect-api-specification: Release SDK 2.3.1 (#77)

* Document changes for 2.3.1 release
  • Loading branch information
Francisco Rojas authored Sep 15, 2017
1 parent 78a651c commit 484b515
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## Version 2.3.1 (2017-09-15)

### New features: Charge Orders

* `Charge` endpoint can charge a specific Order.

## Version 2.3.0 (2017-09-13)

### New features: Orders API
Expand Down
6 changes: 3 additions & 3 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.0</version>
<version>2.3.1</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.0"
compile "com.squareup:connect:2.3.1"
```

### 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.0.jar
* target/connect-2.3.1.jar
* target/lib/*.jar

## Getting Started
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.0'
version = '2.3.1'

buildscript {
repositories {
Expand Down
1 change: 1 addition & 0 deletions docs/ChargeRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Name | Type | Description | Notes
**billingAddress** | [**Address**](Address.md) | The buyer&#39;s billing address. This value is optional, but this transaction is ineligible for chargeback protection if neither this parameter nor &#x60;shipping_address&#x60; is provided. | [optional]
**shippingAddress** | [**Address**](Address.md) | The buyer&#39;s shipping address, if available. This value is optional, but this transaction is ineligible for chargeback protection if neither this parameter nor &#x60;billing_address&#x60; is provided. | [optional]
**buyerEmailAddress** | **String** | The buyer&#39;s email address, if available. This value is optional, but this transaction is ineligible for chargeback protection if it is not provided. | [optional]
**orderId** | **String** | The ID of the order to associate with this transaction. If you provide this value, the &#x60;amount_money&#x60; value of your request must __exactly match__ the &#x60;total_money&#x60; value of the order&#39;s &#x60;order_amounts&#x60; field. | [optional]



2 changes: 1 addition & 1 deletion docs/OrdersApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Name | Type | Description | Notes
CreateOrder

Creates an [Order](#type-order) that can then be referenced as &#x60;order_id&#x60; in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order&#39;s &#x60;id&#x60; in the &#x60;order_id&#x60; field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](https://docs.connect.squareup.com/articles/orders-overview).
Creates an [Order](#type-order) that can then be referenced as &#x60;order_id&#x60; in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order&#39;s &#x60;id&#x60; in the &#x60;order_id&#x60; field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](https://docs.connect.squareup.com/articles/orders-api-overview).

### Example
```java
Expand Down
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.0</version>
<version>2.3.1</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.0");
setUserAgent("Square-Connect-Java/2.3.1");

// Setup authentications (key: authentication name, value: authentication).
authentications = new HashMap<String, Authentication>();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/squareup/connect/api/OrdersApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public BatchRetrieveOrdersResponse batchRetrieveOrders(String locationId, BatchR
}
/**
* CreateOrder
* Creates an [Order](#type-order) that can then be referenced as &#x60;order_id&#x60; in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order&#39;s &#x60;id&#x60; in the &#x60;order_id&#x60; field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](https://docs.connect.squareup.com/articles/orders-overview).
* Creates an [Order](#type-order) that can then be referenced as &#x60;order_id&#x60; in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order&#39;s &#x60;id&#x60; in the &#x60;order_id&#x60; field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](https://docs.connect.squareup.com/articles/orders-api-overview).
* @param locationId The ID of the business location to associate the order with. (required)
* @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. (required)
* @return CreateOrderResponse
Expand Down Expand Up @@ -188,7 +188,7 @@ public CreateOrderResponse createOrder(String locationId, CreateOrderRequest bod

/**
* CreateOrder
* Creates an [Order](#type-order) that can then be referenced as &#x60;order_id&#x60; in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order&#39;s &#x60;id&#x60; in the &#x60;order_id&#x60; field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](https://docs.connect.squareup.com/articles/orders-overview).
* Creates an [Order](#type-order) that can then be referenced as &#x60;order_id&#x60; in a request to the [Charge](#endpoint-charge) endpoint. Orders specify products for purchase, along with discounts, taxes, and other settings to apply to the purchase. To associate a created order with a request to the Charge endpoint, provide the order&#39;s &#x60;id&#x60; in the &#x60;order_id&#x60; field of your request. You cannot modify an order after you create it. If you need to modify an order, instead create a new order with modified details. To learn more about the Orders API, see the [Orders API Overview](https://docs.connect.squareup.com/articles/orders-api-overview).
* @param locationId The ID of the business location to associate the order with. (required)
* @param body An object containing the fields to POST for the request. See the corresponding object definition for field details. (required)
* @return CompleteResponse<CreateOrderResponse>
Expand Down
27 changes: 25 additions & 2 deletions src/main/java/com/squareup/connect/models/ChargeRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public class ChargeRequest {
@JsonProperty("buyer_email_address")
private String buyerEmailAddress = null;

@JsonProperty("order_id")
private String orderId = null;

public ChargeRequest idempotencyKey(String idempotencyKey) {
this.idempotencyKey = idempotencyKey;
return this;
Expand Down Expand Up @@ -259,6 +262,24 @@ public void setBuyerEmailAddress(String buyerEmailAddress) {
this.buyerEmailAddress = buyerEmailAddress;
}

public ChargeRequest orderId(String orderId) {
this.orderId = orderId;
return this;
}

/**
* The ID of the order to associate with this transaction. If you provide this value, the `amount_money` value of your request must __exactly match__ the `total_money` value of the order's `order_amounts` field.
* @return orderId
**/
@ApiModelProperty(value = "The ID of the order to associate with this transaction. If you provide this value, the `amount_money` value of your request must __exactly match__ the `total_money` value of the order's `order_amounts` field.")
public String getOrderId() {
return orderId;
}

public void setOrderId(String orderId) {
this.orderId = orderId;
}


@Override
public boolean equals(java.lang.Object o) {
Expand All @@ -279,12 +300,13 @@ public boolean equals(java.lang.Object o) {
Objects.equals(this.customerId, chargeRequest.customerId) &&
Objects.equals(this.billingAddress, chargeRequest.billingAddress) &&
Objects.equals(this.shippingAddress, chargeRequest.shippingAddress) &&
Objects.equals(this.buyerEmailAddress, chargeRequest.buyerEmailAddress);
Objects.equals(this.buyerEmailAddress, chargeRequest.buyerEmailAddress) &&
Objects.equals(this.orderId, chargeRequest.orderId);
}

@Override
public int hashCode() {
return Objects.hash(idempotencyKey, amountMoney, cardNonce, customerCardId, delayCapture, referenceId, note, customerId, billingAddress, shippingAddress, buyerEmailAddress);
return Objects.hash(idempotencyKey, amountMoney, cardNonce, customerCardId, delayCapture, referenceId, note, customerId, billingAddress, shippingAddress, buyerEmailAddress, orderId);
}


Expand All @@ -304,6 +326,7 @@ public String toString() {
sb.append(" billingAddress: ").append(toIndentedString(billingAddress)).append("\n");
sb.append(" shippingAddress: ").append(toIndentedString(shippingAddress)).append("\n");
sb.append(" buyerEmailAddress: ").append(toIndentedString(buyerEmailAddress)).append("\n");
sb.append(" orderId: ").append(toIndentedString(orderId)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down

0 comments on commit 484b515

Please sign in to comment.