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

Release/2.20190814.0 #61

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGES.md
@@ -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
74 changes: 73 additions & 1 deletion README.md
@@ -1,4 +1,13 @@
# Square Connect Node SDK [![Build Status](https://travis-ci.org/square/connect-javascript-sdk.svg?branch=master)](https://travis-ci.org/square/connect-javascript-sdk)[![npm version](https://badge.fury.io/js/square-connect.svg)](https://badge.fury.io/js/square-connect)
![Square logo]

# Square Connect Node SDK

---

[![Build Status](https://travis-ci.org/square/connect-javascript-sdk.svg?branch=master)](https://travis-ci.org/square/connect-javascript-sdk)
[![npm version](https://badge.fury.io/js/square-connect.svg)](https://badge.fury.io/js/square-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/2uLSRw5)**

Expand Down Expand Up @@ -38,6 +47,20 @@ api.listLocations().then(function(data) {
});
```

### How to configure sandbox environment
```javascript
var SquareConnect = require('square-connect');
var client = SquareConnect.ApiClient.instance;
// Set sandbox url
client.basePath = 'https://connect.squareupsandbox.com';
// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
// Set sandbox access token
oauth2.accessToken = "YOUR SANDBOX ACCESS TOKEN";
// Pass client to API
var api = new SquareConnect.LocationsApi();
```

## Documentation for API Endpoints

All URIs are relative to *https://connect.squareup.com*
Expand Down Expand Up @@ -95,7 +118,18 @@ Class | Method | HTTP request | Description
*SquareConnect.OAuthApi* | [**revokeToken**](docs/OAuthApi.md#revokeToken) | **POST** /oauth2/revoke | RevokeToken
*SquareConnect.OrdersApi* | [**batchRetrieveOrders**](docs/OrdersApi.md#batchRetrieveOrders) | **POST** /v2/locations/{location_id}/orders/batch-retrieve | BatchRetrieveOrders
*SquareConnect.OrdersApi* | [**createOrder**](docs/OrdersApi.md#createOrder) | **POST** /v2/locations/{location_id}/orders | CreateOrder
*SquareConnect.OrdersApi* | [**payOrder**](docs/OrdersApi.md#payOrder) | **POST** /v2/orders/{order_id}/pay | PayOrder
*SquareConnect.OrdersApi* | [**searchOrders**](docs/OrdersApi.md#searchOrders) | **POST** /v2/orders/search | SearchOrders
*SquareConnect.OrdersApi* | [**updateOrder**](docs/OrdersApi.md#updateOrder) | **PUT** /v2/locations/{location_id}/orders/{order_id} | UpdateOrder
*SquareConnect.PaymentsApi* | [**cancelPayment**](docs/PaymentsApi.md#cancelPayment) | **POST** /v2/payments/{payment_id}/cancel | CancelPayment
*SquareConnect.PaymentsApi* | [**cancelPaymentByIdempotencyKey**](docs/PaymentsApi.md#cancelPaymentByIdempotencyKey) | **POST** /v2/payments/cancel | CancelPaymentByIdempotencyKey
*SquareConnect.PaymentsApi* | [**completePayment**](docs/PaymentsApi.md#completePayment) | **POST** /v2/payments/{payment_id}/complete | CompletePayment
*SquareConnect.PaymentsApi* | [**createPayment**](docs/PaymentsApi.md#createPayment) | **POST** /v2/payments | CreatePayment
*SquareConnect.PaymentsApi* | [**getPayment**](docs/PaymentsApi.md#getPayment) | **GET** /v2/payments/{payment_id} | GetPayment
*SquareConnect.PaymentsApi* | [**listPayments**](docs/PaymentsApi.md#listPayments) | **GET** /v2/payments | ListPayments
*SquareConnect.RefundsApi* | [**getPaymentRefund**](docs/RefundsApi.md#getPaymentRefund) | **GET** /v2/refunds/{refund_id} | GetPaymentRefund
*SquareConnect.RefundsApi* | [**listPaymentRefunds**](docs/RefundsApi.md#listPaymentRefunds) | **GET** /v2/refunds | ListPaymentRefunds
*SquareConnect.RefundsApi* | [**refundPayment**](docs/RefundsApi.md#refundPayment) | **POST** /v2/refunds | RefundPayment
*SquareConnect.ReportingApi* | [**listAdditionalRecipientReceivableRefunds**](docs/ReportingApi.md#listAdditionalRecipientReceivableRefunds) | **GET** /v2/locations/{location_id}/additional-recipient-receivable-refunds | ListAdditionalRecipientReceivableRefunds
*SquareConnect.ReportingApi* | [**listAdditionalRecipientReceivables**](docs/ReportingApi.md#listAdditionalRecipientReceivables) | **GET** /v2/locations/{location_id}/additional-recipient-receivables | ListAdditionalRecipientReceivables
*SquareConnect.TransactionsApi* | [**captureTransaction**](docs/TransactionsApi.md#captureTransaction) | **POST** /v2/locations/{location_id}/transactions/{transaction_id}/capture | CaptureTransaction
Expand Down Expand Up @@ -182,6 +216,7 @@ Class | Method | HTTP request | Description
- [SquareConnect.AdditionalRecipientReceivable](docs/AdditionalRecipientReceivable.md)
- [SquareConnect.AdditionalRecipientReceivableRefund](docs/AdditionalRecipientReceivableRefund.md)
- [SquareConnect.Address](docs/Address.md)
- [SquareConnect.BalancePaymentDetails](docs/BalancePaymentDetails.md)
- [SquareConnect.BatchChangeInventoryRequest](docs/BatchChangeInventoryRequest.md)
- [SquareConnect.BatchChangeInventoryResponse](docs/BatchChangeInventoryResponse.md)
- [SquareConnect.BatchDeleteCatalogObjectsRequest](docs/BatchDeleteCatalogObjectsRequest.md)
Expand All @@ -199,10 +234,15 @@ Class | Method | HTTP request | Description
- [SquareConnect.BreakType](docs/BreakType.md)
- [SquareConnect.BusinessHours](docs/BusinessHours.md)
- [SquareConnect.BusinessHoursPeriod](docs/BusinessHoursPeriod.md)
- [SquareConnect.CancelPaymentByIdempotencyKeyRequest](docs/CancelPaymentByIdempotencyKeyRequest.md)
- [SquareConnect.CancelPaymentByIdempotencyKeyResponse](docs/CancelPaymentByIdempotencyKeyResponse.md)
- [SquareConnect.CancelPaymentRequest](docs/CancelPaymentRequest.md)
- [SquareConnect.CancelPaymentResponse](docs/CancelPaymentResponse.md)
- [SquareConnect.CaptureTransactionRequest](docs/CaptureTransactionRequest.md)
- [SquareConnect.CaptureTransactionResponse](docs/CaptureTransactionResponse.md)
- [SquareConnect.Card](docs/Card.md)
- [SquareConnect.CardBrand](docs/CardBrand.md)
- [SquareConnect.CardPaymentDetails](docs/CardPaymentDetails.md)
- [SquareConnect.CatalogCategory](docs/CatalogCategory.md)
- [SquareConnect.CatalogDiscount](docs/CatalogDiscount.md)
- [SquareConnect.CatalogDiscountType](docs/CatalogDiscountType.md)
Expand Down Expand Up @@ -247,6 +287,8 @@ Class | Method | HTTP request | Description
- [SquareConnect.ChargeRequestAdditionalRecipient](docs/ChargeRequestAdditionalRecipient.md)
- [SquareConnect.ChargeResponse](docs/ChargeResponse.md)
- [SquareConnect.Checkout](docs/Checkout.md)
- [SquareConnect.CompletePaymentRequest](docs/CompletePaymentRequest.md)
- [SquareConnect.CompletePaymentResponse](docs/CompletePaymentResponse.md)
- [SquareConnect.Coordinates](docs/Coordinates.md)
- [SquareConnect.Country](docs/Country.md)
- [SquareConnect.CreateBreakTypeRequest](docs/CreateBreakTypeRequest.md)
Expand All @@ -265,6 +307,8 @@ Class | Method | HTTP request | Description
- [SquareConnect.CreateOrderRequestModifier](docs/CreateOrderRequestModifier.md)
- [SquareConnect.CreateOrderRequestTax](docs/CreateOrderRequestTax.md)
- [SquareConnect.CreateOrderResponse](docs/CreateOrderResponse.md)
- [SquareConnect.CreatePaymentRequest](docs/CreatePaymentRequest.md)
- [SquareConnect.CreatePaymentResponse](docs/CreatePaymentResponse.md)
- [SquareConnect.CreateRefundRequest](docs/CreateRefundRequest.md)
- [SquareConnect.CreateRefundResponse](docs/CreateRefundResponse.md)
- [SquareConnect.CreateShiftRequest](docs/CreateShiftRequest.md)
Expand Down Expand Up @@ -303,6 +347,10 @@ Class | Method | HTTP request | Description
- [SquareConnect.GetBreakTypeResponse](docs/GetBreakTypeResponse.md)
- [SquareConnect.GetEmployeeWageRequest](docs/GetEmployeeWageRequest.md)
- [SquareConnect.GetEmployeeWageResponse](docs/GetEmployeeWageResponse.md)
- [SquareConnect.GetPaymentRefundRequest](docs/GetPaymentRefundRequest.md)
- [SquareConnect.GetPaymentRefundResponse](docs/GetPaymentRefundResponse.md)
- [SquareConnect.GetPaymentRequest](docs/GetPaymentRequest.md)
- [SquareConnect.GetPaymentResponse](docs/GetPaymentResponse.md)
- [SquareConnect.GetShiftRequest](docs/GetShiftRequest.md)
- [SquareConnect.GetShiftResponse](docs/GetShiftResponse.md)
- [SquareConnect.InventoryAdjustment](docs/InventoryAdjustment.md)
Expand Down Expand Up @@ -330,6 +378,10 @@ Class | Method | HTTP request | Description
- [SquareConnect.ListEmployeesResponse](docs/ListEmployeesResponse.md)
- [SquareConnect.ListLocationsRequest](docs/ListLocationsRequest.md)
- [SquareConnect.ListLocationsResponse](docs/ListLocationsResponse.md)
- [SquareConnect.ListPaymentRefundsRequest](docs/ListPaymentRefundsRequest.md)
- [SquareConnect.ListPaymentRefundsResponse](docs/ListPaymentRefundsResponse.md)
- [SquareConnect.ListPaymentsRequest](docs/ListPaymentsRequest.md)
- [SquareConnect.ListPaymentsResponse](docs/ListPaymentsResponse.md)
- [SquareConnect.ListRefundsRequest](docs/ListRefundsRequest.md)
- [SquareConnect.ListRefundsResponse](docs/ListRefundsResponse.md)
- [SquareConnect.ListTransactionsRequest](docs/ListTransactionsRequest.md)
Expand All @@ -345,6 +397,8 @@ Class | Method | HTTP request | Description
- [SquareConnect.MeasurementUnitCustom](docs/MeasurementUnitCustom.md)
- [SquareConnect.MeasurementUnitGeneric](docs/MeasurementUnitGeneric.md)
- [SquareConnect.MeasurementUnitLength](docs/MeasurementUnitLength.md)
- [SquareConnect.MeasurementUnitTime](docs/MeasurementUnitTime.md)
- [SquareConnect.MeasurementUnitUnitType](docs/MeasurementUnitUnitType.md)
- [SquareConnect.MeasurementUnitVolume](docs/MeasurementUnitVolume.md)
- [SquareConnect.MeasurementUnitWeight](docs/MeasurementUnitWeight.md)
- [SquareConnect.ModelBreak](docs/ModelBreak.md)
Expand All @@ -357,9 +411,12 @@ Class | Method | HTTP request | Description
- [SquareConnect.OrderFulfillmentPickupDetails](docs/OrderFulfillmentPickupDetails.md)
- [SquareConnect.OrderFulfillmentPickupDetailsScheduleType](docs/OrderFulfillmentPickupDetailsScheduleType.md)
- [SquareConnect.OrderFulfillmentRecipient](docs/OrderFulfillmentRecipient.md)
- [SquareConnect.OrderFulfillmentShipmentDetails](docs/OrderFulfillmentShipmentDetails.md)
- [SquareConnect.OrderFulfillmentState](docs/OrderFulfillmentState.md)
- [SquareConnect.OrderFulfillmentType](docs/OrderFulfillmentType.md)
- [SquareConnect.OrderLineItem](docs/OrderLineItem.md)
- [SquareConnect.OrderLineItemAppliedDiscount](docs/OrderLineItemAppliedDiscount.md)
- [SquareConnect.OrderLineItemAppliedTax](docs/OrderLineItemAppliedTax.md)
- [SquareConnect.OrderLineItemDiscount](docs/OrderLineItemDiscount.md)
- [SquareConnect.OrderLineItemDiscountScope](docs/OrderLineItemDiscountScope.md)
- [SquareConnect.OrderLineItemDiscountType](docs/OrderLineItemDiscountType.md)
Expand All @@ -380,8 +437,15 @@ Class | Method | HTTP request | Description
- [SquareConnect.OrderServiceChargeCalculationPhase](docs/OrderServiceChargeCalculationPhase.md)
- [SquareConnect.OrderSource](docs/OrderSource.md)
- [SquareConnect.OrderState](docs/OrderState.md)
- [SquareConnect.PayOrderRequest](docs/PayOrderRequest.md)
- [SquareConnect.PayOrderResponse](docs/PayOrderResponse.md)
- [SquareConnect.Payment](docs/Payment.md)
- [SquareConnect.PaymentRefund](docs/PaymentRefund.md)
- [SquareConnect.ProcessingFee](docs/ProcessingFee.md)
- [SquareConnect.Product](docs/Product.md)
- [SquareConnect.Refund](docs/Refund.md)
- [SquareConnect.RefundPaymentRequest](docs/RefundPaymentRequest.md)
- [SquareConnect.RefundPaymentResponse](docs/RefundPaymentResponse.md)
- [SquareConnect.RefundStatus](docs/RefundStatus.md)
- [SquareConnect.RegisterDomainRequest](docs/RegisterDomainRequest.md)
- [SquareConnect.RegisterDomainResponse](docs/RegisterDomainResponse.md)
Expand All @@ -402,6 +466,8 @@ Class | Method | HTTP request | Description
- [SquareConnect.RetrieveInventoryCountResponse](docs/RetrieveInventoryCountResponse.md)
- [SquareConnect.RetrieveInventoryPhysicalCountRequest](docs/RetrieveInventoryPhysicalCountRequest.md)
- [SquareConnect.RetrieveInventoryPhysicalCountResponse](docs/RetrieveInventoryPhysicalCountResponse.md)
- [SquareConnect.RetrieveLocationRequest](docs/RetrieveLocationRequest.md)
- [SquareConnect.RetrieveLocationResponse](docs/RetrieveLocationResponse.md)
- [SquareConnect.RetrieveTransactionRequest](docs/RetrieveTransactionRequest.md)
- [SquareConnect.RetrieveTransactionResponse](docs/RetrieveTransactionResponse.md)
- [SquareConnect.RevokeTokenRequest](docs/RevokeTokenRequest.md)
Expand Down Expand Up @@ -456,6 +522,8 @@ Class | Method | HTTP request | Description
- [SquareConnect.UpdateItemModifierListsResponse](docs/UpdateItemModifierListsResponse.md)
- [SquareConnect.UpdateItemTaxesRequest](docs/UpdateItemTaxesRequest.md)
- [SquareConnect.UpdateItemTaxesResponse](docs/UpdateItemTaxesResponse.md)
- [SquareConnect.UpdateOrderRequest](docs/UpdateOrderRequest.md)
- [SquareConnect.UpdateOrderResponse](docs/UpdateOrderResponse.md)
- [SquareConnect.UpdateShiftRequest](docs/UpdateShiftRequest.md)
- [SquareConnect.UpdateShiftResponse](docs/UpdateShiftResponse.md)
- [SquareConnect.UpdateWorkweekConfigRequest](docs/UpdateWorkweekConfigRequest.md)
Expand Down Expand Up @@ -739,3 +807,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```


[//]: # "Link anchor definitions"
[Square Logo]: https://docs.connect.squareup.com/images/github/github-square-logo.svg
13 changes: 13 additions & 0 deletions docs/BalancePaymentDetails.md
@@ -0,0 +1,13 @@
# SquareConnect.BalancePaymentDetails

### Description

Reflects the current status of a balance payment.

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


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


12 changes: 12 additions & 0 deletions docs/CancelPaymentByIdempotencyKeyRequest.md
@@ -0,0 +1,12 @@
# SquareConnect.CancelPaymentByIdempotencyKeyRequest

### Description

Specifies idempotency key of a payment to cancel.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**idempotency_key** | **String** | `idempotency_key` identifying the payment to be canceled. |


12 changes: 12 additions & 0 deletions docs/CancelPaymentByIdempotencyKeyResponse.md
@@ -0,0 +1,12 @@
# SquareConnect.CancelPaymentByIdempotencyKeyResponse

### Description

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

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


11 changes: 11 additions & 0 deletions docs/CancelPaymentRequest.md
@@ -0,0 +1,11 @@
# SquareConnect.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
------------ | ------------- | ------------- | -------------


13 changes: 13 additions & 0 deletions docs/CancelPaymentResponse.md
@@ -0,0 +1,13 @@
# SquareConnect.CancelPaymentResponse

### Description

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

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


2 changes: 1 addition & 1 deletion docs/CaptureTransactionResponse.md
Expand Up @@ -2,7 +2,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
21 changes: 21 additions & 0 deletions docs/CardPaymentDetails.md
@@ -0,0 +1,21 @@
# SquareConnect.CardPaymentDetails

### Description

Reflects the current status of a card payment.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**status** | **String** | The card payment's current state. It can be one of: `AUTHORIZED`, `CAPTURED`, `VOIDED`, `FAILED`. | [optional]
**card** | [**Card**](Card.md) | The credit card's non-confidential details. | [optional]
**entry_method** | **String** | The method used to enter the card's details for the payment. Can be `KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`. | [optional]
**cvv_status** | **String** | Status code returned from the Card Verification Value (CVV) check. | [optional]
**avs_status** | **String** | Status code returned from the Address Verification System (AVS) check. | [optional]
**auth_result_code** | **String** | Status code returned by the card issuer that describes the payment's authorization status. | [optional]
**application_identifier** | **String** | For EMV payments, identifies the EMV application used for the payment | [optional]
**application_name** | **String** | For EMV payments, the human-readable name of the EMV application used for the payment. | [optional]
**application_cryptogram** | **String** | For EMV payments, the cryptogram generated for the payment. | [optional]
**errors** | [**[Error]**](Error.md) | Information on errors encountered during the request. | [optional]


2 changes: 1 addition & 1 deletion docs/ChargeRequest.md
Expand Up @@ -2,7 +2,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
Expand Up @@ -2,7 +2,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
11 changes: 11 additions & 0 deletions docs/CompletePaymentRequest.md
@@ -0,0 +1,11 @@
# SquareConnect.CompletePaymentRequest

### Description

Completes a payment. By default, payments are set to autocomplete immediately after they are created. To complete payments manually, set `autocomplete` to false.

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