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

Commit d5bcdca

Browse files
authored
Release/2.20180918.1 (#51)
* Release 2.20180918.1
1 parent f578e3e commit d5bcdca

13 files changed

+65
-11
lines changed

CHANGES.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Change Log
22

3+
## Version 2.20180918.1 (2018-10-24)
4+
5+
### New feature: Support for Partial Payments in Connect v1
6+
7+
The Connect SDK now supports partial payment functionality for the Connect v1 Transactions API with the addition of a new `Payment` field:
8+
* `Payment.is_partial` — Indicates whether or not the payment is only partially paid for. If `true`, the payment will have the tenders collected so far, but the itemizations will be empty until the payment is completed.
9+
10+
`Tender` also includes 2 new fields to help resolve timing around payments with multiple tenders. Invoices that involve partial payment (e.g., requiring a deposit) may include tenders settled well before the entire payment is completed:
11+
* `Tender.tendered_at` — The time when the tender was accepted by the merchant.
12+
* `Tender.settled_at` — The time when the tender was captured, in ISO 8601 format. Typically the same as (or within moments of) `tendered_at` unless the tender was part of a delay capture transaction.
13+
14+
The change also makes some behavioral changes to the Connect v1 Payment endpoints:
15+
* **Create Refunds** rejects requests for invoices that have partial payments pending.
16+
* **List Payments** takes a new request field, `include_partial` to indicate whether partial payments should be included in the response.
17+
318
## Version 2.20180918.0 (2018-09-18)
419

520
We have added Connect v2 Inventory API and birthdays in `Customer` entities.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ for the specification and template files we used to generate this.
1010
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
1111

1212
- API version: 2.0
13-
- Package version: 2.20180918.0
13+
- Package version: 2.20180918.1
1414
- Build package: io.swagger.codegen.languages.RubyClientCodegen
1515

1616
For more information, please visit [https://squareup.com/developers](https://squareup.com/developers)

docs/V1Payment.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ Name | Type | Description | Notes
3131
**itemizations** | [**Array<V1PaymentItemization>**](V1PaymentItemization.md) | The items purchased in the payment. | [optional]
3232
**surcharge_money** | [**V1Money**](V1Money.md) | The total of all surcharges applied to the payment. | [optional]
3333
**surcharges** | [**Array<V1PaymentSurcharge>**](V1PaymentSurcharge.md) | A list of all surcharges associated with the payment. | [optional]
34+
**is_partial** | **BOOLEAN** | Indicates whether or not the payment is only partially paid for. If true, this payment will have the tenders collected so far, but the itemizations will be empty until the payment is completed. | [optional]
3435

3536

docs/V1PaymentSurcharge.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ Name | Type | Description | Notes
1212
**type** | **String** | Indicates the source of the surcharge. For example, if it was applied as an automatic gratuity for a large group. | [optional]
1313
**taxable** | **BOOLEAN** | Indicates whether the surcharge is taxable. | [optional]
1414
**taxes** | [**Array<V1PaymentTax>**](V1PaymentTax.md) | The list of taxes that should be applied to the surcharge. | [optional]
15-
**surcharge_id** | **String** | | [optional]
15+
**surcharge_id** | **String** | A Square-issued unique identifier associated with the surcharge. | [optional]
1616

1717

docs/V1Tender.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Name | Type | Description | Notes
1616
**payment_note** | **String** | Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER. | [optional]
1717
**total_money** | [**V1Money**](V1Money.md) | The total amount of money provided in this form of tender. | [optional]
1818
**tendered_money** | [**V1Money**](V1Money.md) | The amount of total_money applied to the payment. | [optional]
19+
**tendered_at** | **String** | The time when the tender was created, in ISO 8601 format. | [optional]
20+
**settled_at** | **String** | The time when the tender was settled, in ISO 8601 format. | [optional]
1921
**change_back_money** | [**V1Money**](V1Money.md) | The amount of total_money returned to the buyer as change. | [optional]
2022
**refunded_money** | [**V1Money**](V1Money.md) | The total of all refunds applied to this tender. This amount is always negative or zero. | [optional]
2123
**is_exchange** | **BOOLEAN** | Indicates whether or not the tender is associated with an exchange. If is_exchange is true, the tender represents the value of goods returned in an exchange not the actual money paid. The exchange value reduces the tender amounts needed to pay for items purchased in the exchange. | [optional]

docs/V1TransactionsApi.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ opts = {
210210
begin_time: "begin_time_example", # String | The beginning of the requested reporting period, in ISO 8601 format. If this value is before January 1, 2013 (2013-01-01T00:00:00Z), this endpoint returns an error. Default value: The current time minus one year.
211211
end_time: "end_time_example", # String | The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.
212212
limit: 56, # Integer | The maximum number of payments to return in a single response. This value cannot exceed 200.
213-
batch_token: "batch_token_example" # String | A pagination cursor to retrieve the next set of results for your original query to the endpoint.
213+
batch_token: "batch_token_example", # String | A pagination cursor to retrieve the next set of results for your original query to the endpoint.
214+
include_partial: true # BOOLEAN | Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed.
214215
}
215216

216217
begin
@@ -232,6 +233,7 @@ Name | Type | Description | Notes
232233
**end_time** | **String**| The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time. | [optional]
233234
**limit** | **Integer**| The maximum number of payments to return in a single response. This value cannot exceed 200. | [optional]
234235
**batch_token** | **String**| A pagination cursor to retrieve the next set of results for your original query to the endpoint. | [optional]
236+
**include_partial** | **BOOLEAN**| Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed. | [optional]
235237

236238
### Return type
237239

lib/square_connect/api/v1_transactions_api.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def list_orders_with_http_info(location_id, opts = {})
208208
# @option opts [String] :end_time The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.
209209
# @option opts [Integer] :limit The maximum number of payments to return in a single response. This value cannot exceed 200.
210210
# @option opts [String] :batch_token A pagination cursor to retrieve the next set of results for your original query to the endpoint.
211+
# @option opts [BOOLEAN] :include_partial Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed.
211212
# @return [Array<V1Payment>]
212213
def list_payments(location_id, opts = {})
213214
data, _status_code, _headers = list_payments_with_http_info(location_id, opts)
@@ -223,6 +224,7 @@ def list_payments(location_id, opts = {})
223224
# @option opts [String] :end_time The end of the requested reporting period, in ISO 8601 format. If this value is more than one year greater than begin_time, this endpoint returns an error. Default value: The current time.
224225
# @option opts [Integer] :limit The maximum number of payments to return in a single response. This value cannot exceed 200.
225226
# @option opts [String] :batch_token A pagination cursor to retrieve the next set of results for your original query to the endpoint.
227+
# @option opts [BOOLEAN] :include_partial Indicates whether or not to include partial payments in the response. Partial payments will have the tenders collected so far, but the itemizations will be empty until the payment is completed.
226228
# @return [Array<(Array<V1Payment>, Fixnum, Hash)>] Array<V1Payment> data, response status code and response headers
227229
def list_payments_with_http_info(location_id, opts = {})
228230
if @api_client.config.debugging
@@ -247,6 +249,7 @@ def list_payments_with_http_info(location_id, opts = {})
247249
query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
248250
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
249251
query_params[:'batch_token'] = opts[:'batch_token'] if !opts[:'batch_token'].nil?
252+
query_params[:'include_partial'] = opts[:'include_partial'] if !opts[:'include_partial'].nil?
250253

251254
# header parameters
252255
header_params = {}

lib/square_connect/api_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def initialize(config = Configuration.default)
3030
@config = config
3131

3232
# Construct user agent string. Returns slightly different string for JRuby
33-
@user_agent = "Square-Connect-Ruby/2.20180918.0"
33+
@user_agent = "Square-Connect-Ruby/2.20180918.1"
3434

3535
@default_headers = {
3636
'Content-Type' => "application/json",

lib/square_connect/models/v1_payment.rb

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ class V1Payment
9090
# A list of all surcharges associated with the payment.
9191
attr_accessor :surcharges
9292

93+
# Indicates whether or not the payment is only partially paid for. If true, this payment will have the tenders collected so far, but the itemizations will be empty until the payment is completed.
94+
attr_accessor :is_partial
95+
9396

9497
# Attribute mapping from ruby-style variable name to JSON key.
9598
def self.attribute_map
@@ -119,7 +122,8 @@ def self.attribute_map
119122
:'refunds' => :'refunds',
120123
:'itemizations' => :'itemizations',
121124
:'surcharge_money' => :'surcharge_money',
122-
:'surcharges' => :'surcharges'
125+
:'surcharges' => :'surcharges',
126+
:'is_partial' => :'is_partial'
123127
}
124128
end
125129

@@ -151,7 +155,8 @@ def self.swagger_types
151155
:'refunds' => :'Array<V1Refund>',
152156
:'itemizations' => :'Array<V1PaymentItemization>',
153157
:'surcharge_money' => :'V1Money',
154-
:'surcharges' => :'Array<V1PaymentSurcharge>'
158+
:'surcharges' => :'Array<V1PaymentSurcharge>',
159+
:'is_partial' => :'BOOLEAN'
155160
}
156161
end
157162

@@ -279,6 +284,10 @@ def initialize(attributes = {})
279284
end
280285
end
281286

287+
if attributes.has_key?(:'is_partial')
288+
self.is_partial = attributes[:'is_partial']
289+
end
290+
282291
end
283292

284293
# Show invalid properties with the reasons. Usually used together with valid?
@@ -324,7 +333,8 @@ def ==(o)
324333
refunds == o.refunds &&
325334
itemizations == o.itemizations &&
326335
surcharge_money == o.surcharge_money &&
327-
surcharges == o.surcharges
336+
surcharges == o.surcharges &&
337+
is_partial == o.is_partial
328338
end
329339

330340
# @see the `==` method
@@ -336,7 +346,7 @@ def eql?(o)
336346
# Calculates hash code according to all attributes.
337347
# @return [Fixnum] Hash code
338348
def hash
339-
[id, merchant_id, created_at, creator_id, device, payment_url, receipt_url, inclusive_tax_money, additive_tax_money, tax_money, tip_money, discount_money, total_collected_money, processing_fee_money, net_total_money, refunded_money, swedish_rounding_money, gross_sales_money, net_sales_money, inclusive_tax, additive_tax, tender, refunds, itemizations, surcharge_money, surcharges].hash
349+
[id, merchant_id, created_at, creator_id, device, payment_url, receipt_url, inclusive_tax_money, additive_tax_money, tax_money, tip_money, discount_money, total_collected_money, processing_fee_money, net_total_money, refunded_money, swedish_rounding_money, gross_sales_money, net_sales_money, inclusive_tax, additive_tax, tender, refunds, itemizations, surcharge_money, surcharges, is_partial].hash
340350
end
341351

342352
# Builds the object from hash

lib/square_connect/models/v1_payment_surcharge.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ class V1PaymentSurcharge
3333
# The list of taxes that should be applied to the surcharge.
3434
attr_accessor :taxes
3535

36+
# A Square-issued unique identifier associated with the surcharge.
3637
attr_accessor :surcharge_id
3738

3839
class EnumAttributeValidator

0 commit comments

Comments
 (0)