From 8691afa2ed68c0171c63139c40ef148222421df3 Mon Sep 17 00:00:00 2001 From: Shao-Fu Sung <20245766+shaofu88@users.noreply.github.com> Date: Wed, 5 Dec 2018 15:42:56 -0800 Subject: [PATCH] Release 2.20181205.0 (#40) --- CHANGES.md | 12 ++++ docs/Card.md | 12 ++-- docs/CreateCustomerRequest.md | 1 + docs/Customer.md | 2 +- docs/CustomersApi.md | 2 +- docs/Error.md | 4 ++ docs/ErrorCode.md | 4 ++ docs/InventoryApi.md | 2 +- docs/Product.md | 4 ++ docs/SourceApplication.md | 4 ++ docs/V1Payment.md | 2 +- docs/V1Refund.md | 10 ++++ package.json | 2 +- src/ApiClient.js | 4 +- src/api/ApplePayApi.js | 2 +- src/api/CatalogApi.js | 22 +++---- src/api/CheckoutApi.js | 2 +- src/api/CustomersApi.js | 20 +++---- src/api/InventoryApi.js | 18 +++--- src/api/LocationsApi.js | 2 +- src/api/MobileAuthorizationApi.js | 2 +- src/api/OAuthApi.js | 6 +- src/api/OrdersApi.js | 4 +- src/api/ReportingApi.js | 4 +- src/api/TransactionsApi.js | 14 ++--- src/index.js | 2 +- src/model/Card.js | 14 ++--- src/model/CreateCustomerRequest.js | 9 +++ src/model/Customer.js | 2 +- src/model/Error.js | 10 ++++ src/model/ErrorCode.js | 10 ++++ src/model/Product.js | 10 ++++ src/model/SourceApplication.js | 10 ++++ src/model/V1Payment.js | 2 +- src/model/V1Refund.js | 92 ++++++++++++++++++++++++++++++ 35 files changed, 251 insertions(+), 71 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index c555e8b..fbd2a6a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,17 @@ # Change Log +## Version 2.20181205.0 (2018-12-05) + +## New feature: Idempotent customer profile creation in Connect v2 + +Requests to the CreateCustomer endpoint now include a `idempotency_key` field to +ensure idempotent creation of new profiles. + +## New feature: Refund Adjustment fields for Refunds in Connect v1 + +The Connect SDK now supports refund adjustments for the Connect v1 +Refunds API with the addition of multiple new fields in the `Refund` data type + ## Version 2.20180918.1 (2018-10-24) ### New feature: Support for Partial Payments in Connect v1 diff --git a/docs/Card.md b/docs/Card.md index e9fa059..a4a9a09 100644 --- a/docs/Card.md +++ b/docs/Card.md @@ -3,14 +3,14 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **String** | The card's unique ID, if any. | [optional] +**id** | **String** | Unique ID for this card. Generated by Square. | [optional] **card_brand** | **String** | The card's brand (such as `VISA`). See [CardBrand](#type-cardbrand) for all possible values. | [optional] -**last_4** | **String** | The last 4 digits of the card's number. | [optional] -**exp_month** | **Number** | The month of the card's expiration date. This value is always between `1` and `12`, inclusive. | [optional] +**last_4** | **String** | The last 4 digits of the card number. | [optional] +**exp_month** | **Number** | The expiration month of the associated card as an integer between 1 and 12. | [optional] **exp_year** | **Number** | The four-digit year of the card's expiration date. | [optional] -**cardholder_name** | **String** | The cardholder name. This value is present only if this object represents a customer's card on file. | [optional] -**billing_address** | [**Address**](Address.md) | The card's billing address. This value is present only if this object represents a customer's card on file. | [optional] -**fingerprint** | **String** | The unique string fingerprint for the card. The fingerprint is based on the credit card number and is unique to the merchant. If a card is used at multiple locations for the same merchant, it will have the same fingerprint in each case. Note: Fingerprint may not exist on old transactions. | [optional] +**cardholder_name** | **String** | The name of the cardholder. | [optional] +**billing_address** | [**Address**](Address.md) | The billing address for this card. | [optional] +**fingerprint** | **String** | __Not currently set.__ Intended as a Square-assigned identifier, based on the card number, to identify the card across multiple locations within a single application. | [optional] diff --git a/docs/CreateCustomerRequest.md b/docs/CreateCustomerRequest.md index ef1a6e6..4ce6322 100644 --- a/docs/CreateCustomerRequest.md +++ b/docs/CreateCustomerRequest.md @@ -3,6 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**idempotency_key** | **String** | The idempotency key for the request. See the [Idempotency](/basics/api101/idempotency) guide for more information. | [optional] **given_name** | **String** | The customer's given (i.e., first) name. | [optional] **family_name** | **String** | The customer's family (i.e., last) name. | [optional] **company_name** | **String** | The name of the customer's company. | [optional] diff --git a/docs/Customer.md b/docs/Customer.md index a4065fa..31d586e 100644 --- a/docs/Customer.md +++ b/docs/Customer.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **id** | **String** | The customer's unique ID. | **created_at** | **String** | The time when the customer was created, in RFC 3339 format. | **updated_at** | **String** | The time when the customer was last updated, in RFC 3339 format. | -**cards** | [**[Card]**](Card.md) | The non-confidential details of the customer's cards on file. | [optional] +**cards** | [**[Card]**](Card.md) | The payment details of the customer's cards on file. | [optional] **given_name** | **String** | The customer's given (i.e., first) name. | [optional] **family_name** | **String** | The customer's family (i.e., last) name. | [optional] **nickname** | **String** | The customer's nickname. | [optional] diff --git a/docs/CustomersApi.md b/docs/CustomersApi.md index cec70a9..eeb61ac 100644 --- a/docs/CustomersApi.md +++ b/docs/CustomersApi.md @@ -68,7 +68,7 @@ Name | Type | Description | Notes CreateCustomerCard -Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. As with charges, calls to `CreateCustomerCard` are idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the _first_ call. +Adds a card on file to an existing customer. As with charges, calls to `CreateCustomerCard` are idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the _first_ call. ### Example ```javascript diff --git a/docs/Error.md b/docs/Error.md index 3640f52..d9d9a43 100644 --- a/docs/Error.md +++ b/docs/Error.md @@ -104,6 +104,8 @@ Name | Type | Description | Notes * `EXPECTED_ARRAY` (value: `"EXPECTED_ARRAY"`) +* `EXPECTED_MAP` (value: `"EXPECTED_MAP"`) + * `EXPECTED_BASE64_ENCODED_BYTE_ARRAY` (value: `"EXPECTED_BASE64_ENCODED_BYTE_ARRAY"`) * `INVALID_ARRAY_VALUE` (value: `"INVALID_ARRAY_VALUE"`) @@ -132,6 +134,8 @@ Name | Type | Description | Notes * `UNSUPPORTED_ENTRY_METHOD` (value: `"UNSUPPORTED_ENTRY_METHOD"`) +* `INVALID_ENCRYPTED_CARD` (value: `"INVALID_ENCRYPTED_CARD"`) + * `INVALID_CARD` (value: `"INVALID_CARD"`) * `DELAYED_TRANSACTION_EXPIRED` (value: `"DELAYED_TRANSACTION_EXPIRED"`) diff --git a/docs/ErrorCode.md b/docs/ErrorCode.md index 82e7767..bb854c7 100644 --- a/docs/ErrorCode.md +++ b/docs/ErrorCode.md @@ -75,6 +75,8 @@ * `EXPECTED_ARRAY` (value: `"EXPECTED_ARRAY"`) +* `EXPECTED_MAP` (value: `"EXPECTED_MAP"`) + * `EXPECTED_BASE64_ENCODED_BYTE_ARRAY` (value: `"EXPECTED_BASE64_ENCODED_BYTE_ARRAY"`) * `INVALID_ARRAY_VALUE` (value: `"INVALID_ARRAY_VALUE"`) @@ -103,6 +105,8 @@ * `UNSUPPORTED_ENTRY_METHOD` (value: `"UNSUPPORTED_ENTRY_METHOD"`) +* `INVALID_ENCRYPTED_CARD` (value: `"INVALID_ENCRYPTED_CARD"`) + * `INVALID_CARD` (value: `"INVALID_CARD"`) * `DELAYED_TRANSACTION_EXPIRED` (value: `"DELAYED_TRANSACTION_EXPIRED"`) diff --git a/docs/InventoryApi.md b/docs/InventoryApi.md index 9b47729..231adf1 100644 --- a/docs/InventoryApi.md +++ b/docs/InventoryApi.md @@ -115,7 +115,7 @@ Name | Type | Description | Notes BatchRetrieveInventoryCounts -Returns current counts for the provided [CatalogObject](#type-catalogobject)s at the requested [Location](#type-location)s. Results are paginated and sorted in descending order according to their `calculated_at` timestamp (newest first). When `updated_at` is specified, only counts that have changed since that time (based on the server timestamp for the most recent change) are returned. This allows clients to perform a \"sync\" operation, for example in response to receiving a Webhook notification. +Returns current counts for the provided [CatalogObject](#type-catalogobject)s at the requested [Location](#type-location)s. Results are paginated and sorted in descending order according to their `calculated_at` timestamp (newest first). When `updated_after` is specified, only counts that have changed since that time (based on the server timestamp for the most recent change) are returned. This allows clients to perform a \"sync\" operation, for example in response to receiving a Webhook notification. ### Example ```javascript diff --git a/docs/Product.md b/docs/Product.md index f786f9d..50e1cca 100644 --- a/docs/Product.md +++ b/docs/Product.md @@ -17,6 +17,10 @@ * `PAYROLL` (value: `"PAYROLL"`) +* `DASHBOARD` (value: `"DASHBOARD"`) + +* `ITEM_LIBRARY_IMPORT` (value: `"ITEM_LIBRARY_IMPORT"`) + * `OTHER` (value: `"OTHER"`) diff --git a/docs/SourceApplication.md b/docs/SourceApplication.md index 47121d5..cdf8115 100644 --- a/docs/SourceApplication.md +++ b/docs/SourceApplication.md @@ -26,6 +26,10 @@ Name | Type | Description | Notes * `PAYROLL` (value: `"PAYROLL"`) +* `DASHBOARD` (value: `"DASHBOARD"`) + +* `ITEM_LIBRARY_IMPORT` (value: `"ITEM_LIBRARY_IMPORT"`) + * `OTHER` (value: `"OTHER"`) diff --git a/docs/V1Payment.md b/docs/V1Payment.md index f0606df..0a6d42f 100644 --- a/docs/V1Payment.md +++ b/docs/V1Payment.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **String** | The payment's unique identifier. | [optional] **merchant_id** | **String** | The unique identifier of the merchant that took the payment. | [optional] -**created_at** | **String** | The time when the payment was created, in ISO 8601 format. | [optional] +**created_at** | **String** | The time when the payment was created, in ISO 8601 format. Reflects the time of the first payment if the object represents an incomplete partial payment, and the time of the last or complete payment otherwise. | [optional] **creator_id** | **String** | The unique identifier of the Square account that took the payment. | [optional] **device** | [**Device**](Device.md) | The device that took the payment. | [optional] **payment_url** | **String** | The URL of the payment's detail page in the merchant dashboard. The merchant must be signed in to the merchant dashboard to view this page. | [optional] diff --git a/docs/V1Refund.md b/docs/V1Refund.md index a23090f..209446e 100644 --- a/docs/V1Refund.md +++ b/docs/V1Refund.md @@ -6,6 +6,16 @@ Name | Type | Description | Notes **type** | **String** | The type of refund | [optional] **reason** | **String** | The merchant-specified reason for the refund. | [optional] **refunded_money** | [**V1Money**](V1Money.md) | The amount of money refunded. This amount is always negative. | [optional] +**refunded_processing_fee_money** | [**V1Money**](V1Money.md) | The amount of processing fee money refunded. This amount is always positive. | [optional] +**refunded_tax_money** | [**V1Money**](V1Money.md) | The total amount of tax money refunded. This amount is always negative. | [optional] +**refunded_additive_tax_money** | [**V1Money**](V1Money.md) | The amount of additive tax money refunded. This amount is always negative. | [optional] +**refunded_additive_tax** | [**[V1PaymentTax]**](V1PaymentTax.md) | All of the additive taxes associated with the refund. | [optional] +**refunded_inclusive_tax_money** | [**V1Money**](V1Money.md) | The amount of inclusive tax money refunded. This amount is always negative. | [optional] +**refunded_inclusive_tax** | [**[V1PaymentTax]**](V1PaymentTax.md) | All of the inclusive taxes associated with the refund. | [optional] +**refunded_tip_money** | [**V1Money**](V1Money.md) | The amount of tip money refunded. This amount is always negative. | [optional] +**refunded_discount_money** | [**V1Money**](V1Money.md) | The amount of discount money refunded. This amount is always positive. | [optional] +**refunded_surcharge_money** | [**V1Money**](V1Money.md) | The amount of surcharge money refunded. This amount is always negative. | [optional] +**refunded_surcharges** | [**[V1PaymentSurcharge]**](V1PaymentSurcharge.md) | A list of all surcharges associated with the refund. | [optional] **created_at** | **String** | The time when the merchant initiated the refund for Square to process, in ISO 8601 format. | [optional] **processed_at** | **String** | The time when Square processed the refund on behalf of the merchant, in ISO 8601 format. | [optional] **payment_id** | **String** | A Square-issued ID associated with the refund. For single-tender refunds, payment_id is the ID of the original payment ID. For split-tender refunds, payment_id is the ID of the original tender. For exchange-based refunds (is_exchange == true), payment_id is the ID of the original payment ID even if the payment includes other tenders. | [optional] diff --git a/package.json b/package.json index 1e02a1e..70e0807 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "square-connect", - "version": "2.20180918.1", + "version": "2.20181205.0", "description": "JavaScript client library for the Square Connect v2 API", "keywords": [ "square", diff --git a/src/ApiClient.js b/src/ApiClient.js index 3367e12..0ca066f 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -16,7 +16,7 @@ var querystring = require('querystring'); /** * @module ApiClient - * @version 2.20180918.1 + * @version 2.20181205.0 */ /** @@ -48,7 +48,7 @@ var exports = function() { * @default {} */ this.defaultHeaders = { - 'User-Agent': 'Square-Connect-Javascript/2.20180918.1' + 'User-Agent': 'Square-Connect-Javascript/2.20181205.0' }; /** * The default HTTP timeout for all API calls. diff --git a/src/api/ApplePayApi.js b/src/api/ApplePayApi.js index e66602f..296daad 100644 --- a/src/api/ApplePayApi.js +++ b/src/api/ApplePayApi.js @@ -53,7 +53,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/api/CatalogApi.js b/src/api/CatalogApi.js index 3b7ca31..7962039 100644 --- a/src/api/CatalogApi.js +++ b/src/api/CatalogApi.js @@ -69,7 +69,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -121,7 +121,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -173,7 +173,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -219,7 +219,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -271,7 +271,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -323,7 +323,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -382,7 +382,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -436,7 +436,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -488,7 +488,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -540,7 +540,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -592,7 +592,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/api/CheckoutApi.js b/src/api/CheckoutApi.js index a852311..bb1d03e 100644 --- a/src/api/CheckoutApi.js +++ b/src/api/CheckoutApi.js @@ -60,7 +60,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/api/CustomersApi.js b/src/api/CustomersApi.js index dcd9503..04638d4 100644 --- a/src/api/CustomersApi.js +++ b/src/api/CustomersApi.js @@ -63,7 +63,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -96,7 +96,7 @@ module.exports = function(apiClient) { /** * CreateCustomerCard - * Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. As with charges, calls to `CreateCustomerCard` are idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the _first_ call. + * Adds a card on file to an existing customer. As with charges, calls to `CreateCustomerCard` are idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the _first_ call. * @param {String} customerId The ID of the customer to link the card on file to. * @param {module:model/CreateCustomerCardRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CreateCustomerCardResponse} and HTTP response @@ -122,7 +122,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -141,7 +141,7 @@ module.exports = function(apiClient) { /** * CreateCustomerCard - * Adds a card on file to an existing customer. In the United States Square takes care of automatically updating any cards on file that might have expired since you first attached them to a customer. As with charges, calls to `CreateCustomerCard` are idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the _first_ call. + * Adds a card on file to an existing customer. As with charges, calls to `CreateCustomerCard` are idempotent. Multiple calls with the same card nonce return the same card record that was created with the provided nonce during the _first_ call. * @param {String} customerId The ID of the customer to link the card on file to. * @param {module:model/CreateCustomerCardRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CreateCustomerCardResponse} @@ -176,7 +176,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -236,7 +236,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -291,7 +291,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -347,7 +347,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -399,7 +399,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -458,7 +458,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/api/InventoryApi.js b/src/api/InventoryApi.js index fdbe83a..59c20de 100644 --- a/src/api/InventoryApi.js +++ b/src/api/InventoryApi.js @@ -61,7 +61,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -113,7 +113,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -146,7 +146,7 @@ module.exports = function(apiClient) { /** * BatchRetrieveInventoryCounts - * Returns current counts for the provided [CatalogObject](#type-catalogobject)s at the requested [Location](#type-location)s. Results are paginated and sorted in descending order according to their `calculated_at` timestamp (newest first). When `updated_at` is specified, only counts that have changed since that time (based on the server timestamp for the most recent change) are returned. This allows clients to perform a \"sync\" operation, for example in response to receiving a Webhook notification. + * Returns current counts for the provided [CatalogObject](#type-catalogobject)s at the requested [Location](#type-location)s. Results are paginated and sorted in descending order according to their `calculated_at` timestamp (newest first). When `updated_after` is specified, only counts that have changed since that time (based on the server timestamp for the most recent change) are returned. This allows clients to perform a \"sync\" operation, for example in response to receiving a Webhook notification. * @param {module:model/BatchRetrieveInventoryCountsRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/BatchRetrieveInventoryCountsResponse} and HTTP response */ @@ -165,7 +165,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -184,7 +184,7 @@ module.exports = function(apiClient) { /** * BatchRetrieveInventoryCounts - * Returns current counts for the provided [CatalogObject](#type-catalogobject)s at the requested [Location](#type-location)s. Results are paginated and sorted in descending order according to their `calculated_at` timestamp (newest first). When `updated_at` is specified, only counts that have changed since that time (based on the server timestamp for the most recent change) are returned. This allows clients to perform a \"sync\" operation, for example in response to receiving a Webhook notification. + * Returns current counts for the provided [CatalogObject](#type-catalogobject)s at the requested [Location](#type-location)s. Results are paginated and sorted in descending order according to their `calculated_at` timestamp (newest first). When `updated_after` is specified, only counts that have changed since that time (based on the server timestamp for the most recent change) are returned. This allows clients to perform a \"sync\" operation, for example in response to receiving a Webhook notification. * @param {module:model/BatchRetrieveInventoryCountsRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/BatchRetrieveInventoryCountsResponse} */ @@ -218,7 +218,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -277,7 +277,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -339,7 +339,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -395,7 +395,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/api/LocationsApi.js b/src/api/LocationsApi.js index 91552c5..0a99852 100644 --- a/src/api/LocationsApi.js +++ b/src/api/LocationsApi.js @@ -46,7 +46,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/api/MobileAuthorizationApi.js b/src/api/MobileAuthorizationApi.js index 3f18477..b9d1a93 100644 --- a/src/api/MobileAuthorizationApi.js +++ b/src/api/MobileAuthorizationApi.js @@ -53,7 +53,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/api/OAuthApi.js b/src/api/OAuthApi.js index 4a54e47..cc51aef 100644 --- a/src/api/OAuthApi.js +++ b/src/api/OAuthApi.js @@ -57,7 +57,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -116,7 +116,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -169,7 +169,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/api/OrdersApi.js b/src/api/OrdersApi.js index c3821da..77d0359 100644 --- a/src/api/OrdersApi.js +++ b/src/api/OrdersApi.js @@ -62,7 +62,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -122,7 +122,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/api/ReportingApi.js b/src/api/ReportingApi.js index 7fca5c1..3d5a35d 100644 --- a/src/api/ReportingApi.js +++ b/src/api/ReportingApi.js @@ -64,7 +64,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -132,7 +132,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/api/TransactionsApi.js b/src/api/TransactionsApi.js index ef3c5d9..016151c 100644 --- a/src/api/TransactionsApi.js +++ b/src/api/TransactionsApi.js @@ -68,7 +68,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -128,7 +128,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -195,7 +195,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -260,7 +260,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -328,7 +328,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -393,7 +393,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; @@ -454,7 +454,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2018-09-18'; + headerParams['Square-Version'] = '2018-12-05'; var formParams = { }; diff --git a/src/index.js b/src/index.js index a3773f5..1073c1e 100644 --- a/src/index.js +++ b/src/index.js @@ -281,7 +281,7 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * *

* @module index - * @version 2.20180918.1 + * @version 2.20181205.0 */ module.exports = { /** diff --git a/src/model/Card.js b/src/model/Card.js index 78ceee2..ddef249 100644 --- a/src/model/Card.js +++ b/src/model/Card.js @@ -24,7 +24,7 @@ var Address = require('./Address'); /** * Constructs a new Card. - * Represents the non-confidential details of a credit card. + * Represents the payment details of a card to be used for payments. These details are determined by the `card_nonce` generated by `SqPaymentForm`. * @alias module:model/Card * @class */ @@ -81,7 +81,7 @@ exports.constructFromObject = function(data, obj) { } /** - * The card's unique ID, if any. + * Unique ID for this card. Generated by Square. * @member {String} id */ exports.prototype['id'] = undefined; @@ -91,12 +91,12 @@ exports.prototype['id'] = undefined; */ exports.prototype['card_brand'] = undefined; /** - * The last 4 digits of the card's number. + * The last 4 digits of the card number. * @member {String} last_4 */ exports.prototype['last_4'] = undefined; /** - * The month of the card's expiration date. This value is always between `1` and `12`, inclusive. + * The expiration month of the associated card as an integer between 1 and 12. * @member {Number} exp_month */ exports.prototype['exp_month'] = undefined; @@ -106,17 +106,17 @@ exports.prototype['exp_month'] = undefined; */ exports.prototype['exp_year'] = undefined; /** - * The cardholder name. This value is present only if this object represents a customer's card on file. + * The name of the cardholder. * @member {String} cardholder_name */ exports.prototype['cardholder_name'] = undefined; /** - * The card's billing address. This value is present only if this object represents a customer's card on file. + * The billing address for this card. * @member {module:model/Address} billing_address */ exports.prototype['billing_address'] = undefined; /** - * The unique string fingerprint for the card. The fingerprint is based on the credit card number and is unique to the merchant. If a card is used at multiple locations for the same merchant, it will have the same fingerprint in each case. Note: Fingerprint may not exist on old transactions. + * __Not currently set.__ Intended as a Square-assigned identifier, based on the card number, to identify the card across multiple locations within a single application. * @member {String} fingerprint */ exports.prototype['fingerprint'] = undefined; diff --git a/src/model/CreateCustomerRequest.js b/src/model/CreateCustomerRequest.js index 42adfe3..e7d6374 100644 --- a/src/model/CreateCustomerRequest.js +++ b/src/model/CreateCustomerRequest.js @@ -41,6 +41,7 @@ var exports = function() { + }; /** @@ -54,6 +55,9 @@ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); + if (data.hasOwnProperty('idempotency_key')) { + obj['idempotency_key'] = ApiClient.convertToType(data['idempotency_key'], 'String'); + } if (data.hasOwnProperty('given_name')) { obj['given_name'] = ApiClient.convertToType(data['given_name'], 'String'); } @@ -88,6 +92,11 @@ exports.constructFromObject = function(data, obj) { return obj; } +/** + * The idempotency key for the request. See the [Idempotency](/basics/api101/idempotency) guide for more information. + * @member {String} idempotency_key + */ +exports.prototype['idempotency_key'] = undefined; /** * The customer's given (i.e., first) name. * @member {String} given_name diff --git a/src/model/Customer.js b/src/model/Customer.js index 27bca68..ca6c80a 100644 --- a/src/model/Customer.js +++ b/src/model/Customer.js @@ -138,7 +138,7 @@ exports.prototype['created_at'] = undefined; */ exports.prototype['updated_at'] = undefined; /** - * The non-confidential details of the customer's cards on file. + * The payment details of the customer's cards on file. * @member {Array.} cards */ exports.prototype['cards'] = undefined; diff --git a/src/model/Error.js b/src/model/Error.js index b594813..2d6a370 100644 --- a/src/model/Error.js +++ b/src/model/Error.js @@ -310,6 +310,11 @@ exports.prototype['field'] = undefined; * @const */ "EXPECTED_ARRAY": "EXPECTED_ARRAY", + /** + * value: "EXPECTED_MAP" + * @const + */ + "EXPECTED_MAP": "EXPECTED_MAP", /** * value: "EXPECTED_BASE64_ENCODED_BYTE_ARRAY" * @const @@ -380,6 +385,11 @@ exports.prototype['field'] = undefined; * @const */ "UNSUPPORTED_ENTRY_METHOD": "UNSUPPORTED_ENTRY_METHOD", + /** + * value: "INVALID_ENCRYPTED_CARD" + * @const + */ + "INVALID_ENCRYPTED_CARD": "INVALID_ENCRYPTED_CARD", /** * value: "INVALID_CARD" * @const diff --git a/src/model/ErrorCode.js b/src/model/ErrorCode.js index 1da96cb..50917d2 100644 --- a/src/model/ErrorCode.js +++ b/src/model/ErrorCode.js @@ -200,6 +200,11 @@ var exports = { * @const */ "EXPECTED_ARRAY": "EXPECTED_ARRAY", + /** + * value: "EXPECTED_MAP" + * @const + */ + "EXPECTED_MAP": "EXPECTED_MAP", /** * value: "EXPECTED_BASE64_ENCODED_BYTE_ARRAY" * @const @@ -270,6 +275,11 @@ var exports = { * @const */ "UNSUPPORTED_ENTRY_METHOD": "UNSUPPORTED_ENTRY_METHOD", + /** + * value: "INVALID_ENCRYPTED_CARD" + * @const + */ + "INVALID_ENCRYPTED_CARD": "INVALID_ENCRYPTED_CARD", /** * value: "INVALID_CARD" * @const diff --git a/src/model/Product.js b/src/model/Product.js index 98b6936..7b6e335 100644 --- a/src/model/Product.js +++ b/src/model/Product.js @@ -55,6 +55,16 @@ var exports = { * @const */ "PAYROLL": "PAYROLL", + /** + * value: "DASHBOARD" + * @const + */ + "DASHBOARD": "DASHBOARD", + /** + * value: "ITEM_LIBRARY_IMPORT" + * @const + */ + "ITEM_LIBRARY_IMPORT": "ITEM_LIBRARY_IMPORT", /** * value: "OTHER" * @const diff --git a/src/model/SourceApplication.js b/src/model/SourceApplication.js index 9eb38b8..0827bfd 100644 --- a/src/model/SourceApplication.js +++ b/src/model/SourceApplication.js @@ -117,6 +117,16 @@ exports.prototype['name'] = undefined; * @const */ "PAYROLL": "PAYROLL", + /** + * value: "DASHBOARD" + * @const + */ + "DASHBOARD": "DASHBOARD", + /** + * value: "ITEM_LIBRARY_IMPORT" + * @const + */ + "ITEM_LIBRARY_IMPORT": "ITEM_LIBRARY_IMPORT", /** * value: "OTHER" * @const diff --git a/src/model/V1Payment.js b/src/model/V1Payment.js index 4cff76d..a3439ac 100644 --- a/src/model/V1Payment.js +++ b/src/model/V1Payment.js @@ -172,7 +172,7 @@ exports.prototype['id'] = undefined; */ exports.prototype['merchant_id'] = undefined; /** - * The time when the payment was created, in ISO 8601 format. + * The time when the payment was created, in ISO 8601 format. Reflects the time of the first payment if the object represents an incomplete partial payment, and the time of the last or complete payment otherwise. * @member {String} created_at */ exports.prototype['created_at'] = undefined; diff --git a/src/model/V1Refund.js b/src/model/V1Refund.js index 318663b..6aaa841 100644 --- a/src/model/V1Refund.js +++ b/src/model/V1Refund.js @@ -13,6 +13,8 @@ */ var ApiClient = require('../ApiClient'); var V1Money = require('./V1Money'); +var V1PaymentSurcharge = require('./V1PaymentSurcharge'); +var V1PaymentTax = require('./V1PaymentTax'); @@ -38,6 +40,16 @@ var exports = function() { + + + + + + + + + + }; /** @@ -59,6 +71,36 @@ exports.constructFromObject = function(data, obj) { } if (data.hasOwnProperty('refunded_money')) { obj['refunded_money'] = V1Money.constructFromObject(data['refunded_money']); + } + if (data.hasOwnProperty('refunded_processing_fee_money')) { + obj['refunded_processing_fee_money'] = V1Money.constructFromObject(data['refunded_processing_fee_money']); + } + if (data.hasOwnProperty('refunded_tax_money')) { + obj['refunded_tax_money'] = V1Money.constructFromObject(data['refunded_tax_money']); + } + if (data.hasOwnProperty('refunded_additive_tax_money')) { + obj['refunded_additive_tax_money'] = V1Money.constructFromObject(data['refunded_additive_tax_money']); + } + if (data.hasOwnProperty('refunded_additive_tax')) { + obj['refunded_additive_tax'] = ApiClient.convertToType(data['refunded_additive_tax'], [V1PaymentTax]); + } + if (data.hasOwnProperty('refunded_inclusive_tax_money')) { + obj['refunded_inclusive_tax_money'] = V1Money.constructFromObject(data['refunded_inclusive_tax_money']); + } + if (data.hasOwnProperty('refunded_inclusive_tax')) { + obj['refunded_inclusive_tax'] = ApiClient.convertToType(data['refunded_inclusive_tax'], [V1PaymentTax]); + } + if (data.hasOwnProperty('refunded_tip_money')) { + obj['refunded_tip_money'] = V1Money.constructFromObject(data['refunded_tip_money']); + } + if (data.hasOwnProperty('refunded_discount_money')) { + obj['refunded_discount_money'] = V1Money.constructFromObject(data['refunded_discount_money']); + } + if (data.hasOwnProperty('refunded_surcharge_money')) { + obj['refunded_surcharge_money'] = V1Money.constructFromObject(data['refunded_surcharge_money']); + } + if (data.hasOwnProperty('refunded_surcharges')) { + obj['refunded_surcharges'] = ApiClient.convertToType(data['refunded_surcharges'], [V1PaymentSurcharge]); } if (data.hasOwnProperty('created_at')) { obj['created_at'] = ApiClient.convertToType(data['created_at'], 'String'); @@ -94,6 +136,56 @@ exports.prototype['reason'] = undefined; * @member {module:model/V1Money} refunded_money */ exports.prototype['refunded_money'] = undefined; +/** + * The amount of processing fee money refunded. This amount is always positive. + * @member {module:model/V1Money} refunded_processing_fee_money + */ +exports.prototype['refunded_processing_fee_money'] = undefined; +/** + * The total amount of tax money refunded. This amount is always negative. + * @member {module:model/V1Money} refunded_tax_money + */ +exports.prototype['refunded_tax_money'] = undefined; +/** + * The amount of additive tax money refunded. This amount is always negative. + * @member {module:model/V1Money} refunded_additive_tax_money + */ +exports.prototype['refunded_additive_tax_money'] = undefined; +/** + * All of the additive taxes associated with the refund. + * @member {Array.} refunded_additive_tax + */ +exports.prototype['refunded_additive_tax'] = undefined; +/** + * The amount of inclusive tax money refunded. This amount is always negative. + * @member {module:model/V1Money} refunded_inclusive_tax_money + */ +exports.prototype['refunded_inclusive_tax_money'] = undefined; +/** + * All of the inclusive taxes associated with the refund. + * @member {Array.} refunded_inclusive_tax + */ +exports.prototype['refunded_inclusive_tax'] = undefined; +/** + * The amount of tip money refunded. This amount is always negative. + * @member {module:model/V1Money} refunded_tip_money + */ +exports.prototype['refunded_tip_money'] = undefined; +/** + * The amount of discount money refunded. This amount is always positive. + * @member {module:model/V1Money} refunded_discount_money + */ +exports.prototype['refunded_discount_money'] = undefined; +/** + * The amount of surcharge money refunded. This amount is always negative. + * @member {module:model/V1Money} refunded_surcharge_money + */ +exports.prototype['refunded_surcharge_money'] = undefined; +/** + * A list of all surcharges associated with the refund. + * @member {Array.} refunded_surcharges + */ +exports.prototype['refunded_surcharges'] = undefined; /** * The time when the merchant initiated the refund for Square to process, in ISO 8601 format. * @member {String} created_at