Skip to content

Commit 39c5233

Browse files
committed
Add additional updatedAtBeginTime, updatedAtEndTime, and sortField query parameters to listPaymentRefunds endpoint.
1 parent a184ac3 commit 39c5233

File tree

9 files changed

+30
-11
lines changed

9 files changed

+30
-11
lines changed

doc/api/refunds.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ def list_payment_refunds(begin_time: nil,
3232
location_id: nil,
3333
status: nil,
3434
source_type: nil,
35-
limit: nil)
35+
limit: nil,
36+
updated_at_begin_time: nil,
37+
updated_at_end_time: nil,
38+
sort_field: nil)
3639
```
3740

3841
## Parameters
@@ -47,6 +50,9 @@ def list_payment_refunds(begin_time: nil,
4750
| `status` | `String` | Query, Optional | If provided, only refunds with the given status are returned.<br>For a list of refund status values, see [PaymentRefund](entity:PaymentRefund).<br><br>Default: If omitted, refunds are returned regardless of their status. |
4851
| `source_type` | `String` | Query, Optional | If provided, only returns refunds whose payments have the indicated source type.<br>Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`.<br>For information about these payment source types, see<br>[Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).<br><br>Default: If omitted, refunds are returned regardless of the source type. |
4952
| `limit` | `Integer` | Query, Optional | The maximum number of results to be returned in a single page.<br><br>It is possible to receive fewer results than the specified limit on a given page.<br><br>If the supplied value is greater than 100, no more than 100 results are returned.<br><br>Default: 100 |
53+
| `updated_at_begin_time` | `string` | Query, Optional | Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339<br>format. The range is determined using the `updated_at` field for each `PaymentRefund`.<br><br>Default: if omitted, the time range starts at `begin_time`. |
54+
| `updated_at_end_time` | `string` | Query, Optional | Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339<br>format. The range is determined using the `updated_at` field for each `PaymentRefund`.<br><br>Default: The current time. |
55+
| `sort_field` | `string` | Query, Optional | The field used to sort results by. The default is `CREATED_AT`.<br>Current values include `CREATED_AT` and `UPDATED_AT`.<br> |
5056

5157
## Response Type
5258

doc/client.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The following parameters are configurable for the API Client:
55

66
| Parameter | Type | Description |
77
| --- | --- | --- |
8-
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2025-01-23'` |
8+
| `square_version` | `String` | Square Connect API versions<br>*Default*: `'2025-02-20'` |
99
| `custom_url` | `String` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`<br>*Default*: `'https://connect.squareup.com'` |
1010
| `environment` | `string` | The API environment. <br> **Default: `production`** |
1111
| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
@@ -25,7 +25,7 @@ The API client can be initialized as follows:
2525

2626
```ruby
2727
client = Square::Client.new(
28-
square_version: '2025-01-23',
28+
square_version: '2025-02-20',
2929
bearer_auth_credentials: BearerAuthCredentials.new(
3030
access_token: 'AccessToken'
3131
),
@@ -55,7 +55,7 @@ require 'square'
5555
include Square
5656

5757
client = Square::Client.new(
58-
square_version: '2025-01-23',
58+
square_version: '2025-02-20',
5959
bearer_auth_credentials: BearerAuthCredentials.new(
6060
access_token: 'AccessToken'
6161
),

doc/models/list-payment-refunds-request.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ The maximum results per page is 100.
1616
| --- | --- | --- | --- |
1717
| `begin_time` | `String` | Optional | Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339<br>format. The range is determined using the `created_at` field for each `PaymentRefund`.<br><br>Default: The current time minus one year. |
1818
| `end_time` | `String` | Optional | Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339<br>format. The range is determined using the `created_at` field for each `PaymentRefund`.<br><br>Default: The current time. |
19+
1920
| `sort_order` | `String` | Optional | The order in which results are listed by `PaymentRefund.created_at`:<br><br>- `ASC` - Oldest to newest.<br>- `DESC` - Newest to oldest (default). |
2021
| `cursor` | `String` | Optional | A pagination cursor returned by a previous call to this endpoint.<br>Provide this cursor to retrieve the next set of results for the original query.<br><br>For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination). |
2122
| `location_id` | `String` | Optional | Limit results to the location supplied. By default, results are returned<br>for all locations associated with the seller. |
2223
| `status` | `String` | Optional | If provided, only refunds with the given status are returned.<br>For a list of refund status values, see [PaymentRefund](entity:PaymentRefund).<br><br>Default: If omitted, refunds are returned regardless of their status. |
2324
| `source_type` | `String` | Optional | If provided, only returns refunds whose payments have the indicated source type.<br>Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `CASH`, and `EXTERNAL`.<br>For information about these payment source types, see<br>[Take Payments](https://developer.squareup.com/docs/payments-api/take-payments).<br><br>Default: If omitted, refunds are returned regardless of the source type. |
2425
| `limit` | `Integer` | Optional | The maximum number of results to be returned in a single page.<br><br>It is possible to receive fewer results than the specified limit on a given page.<br><br>If the supplied value is greater than 100, no more than 100 results are returned.<br><br>Default: 100 |
26+
| `updated_at_begin_time` | `String` | Optional | Indicates the start of the time range to retrieve each `PaymentRefund` for, in RFC 3339<br>format. The range is determined using the `updated_at` field for each `PaymentRefund`.<br><br>Default: if omitted, the time range starts at `begin_time`. |
27+
| `updated_at_end_time` | `String` | Optional | Indicates the end of the time range to retrieve each `PaymentRefund` for, in RFC 3339<br>format. The range is determined using the `updated_at` field for each `PaymentRefund`.<br><br>Default: The current time. |
28+
| `sort_field` | `String` | Optional | The field used to sort results by. The default is `CREATED_AT`.<br>Current values include `CREATED_AT` and `UPDATED_AT`.<br> |
2529

2630
## Example (as JSON)
2731

lib/square/api/base_api.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class BaseApi
55
attr_accessor :config, :http_call_back
66

77
def self.user_agent
8-
'Square-Ruby-SDK/41.0.0.20250123 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
8+
'Square-Ruby-SDK/41.1.0.20250220 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
99
end
1010

1111
def self.user_agent_parameters

lib/square/api/refunds_api.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ def list_payment_refunds(begin_time: nil,
4848
location_id: nil,
4949
status: nil,
5050
source_type: nil,
51-
limit: nil)
51+
limit: nil,
52+
updated_at_begin_time: nil,
53+
updated_at_end_time: nil,
54+
sort_field: nil)
5255
new_api_call_builder
5356
.request(new_request_builder(HttpMethodEnum::GET,
5457
'/v2/refunds',
@@ -61,6 +64,9 @@ def list_payment_refunds(begin_time: nil,
6164
.query_param(new_parameter(status, key: 'status'))
6265
.query_param(new_parameter(source_type, key: 'source_type'))
6366
.query_param(new_parameter(limit, key: 'limit'))
67+
.query_param(new_parameter(updated_at_begin_time, key: 'updated_at_begin_time'))
68+
.query_param(new_parameter(updated_at_end_time, key: 'updated_at_end_time'))
69+
.query_param(new_parameter(sort_field, key: 'sort_field'))
6470
.header_param(new_parameter('application/json', key: 'accept'))
6571
.auth(Single.new('global')))
6672
.response(new_response_handler

lib/square/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class Client
55
attr_reader :config, :auth_managers
66

77
def sdk_version
8-
'41.0.0.20250123'
8+
'41.1.0.20250220'
99
end
1010

1111
def square_version
@@ -274,7 +274,7 @@ def initialize(
274274
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
275275
retry_methods: %i[get put], http_callback: nil, environment: 'production',
276276
custom_url: 'https://connect.squareup.com', access_token: nil,
277-
bearer_auth_credentials: nil, square_version: '2025-01-23',
277+
bearer_auth_credentials: nil, square_version: '2025-02-20',
278278
user_agent_detail: '', additional_headers: {}, config: nil
279279
)
280280
@config = if config.nil?

lib/square/configuration.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def initialize(
2424
retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
2525
retry_methods: %i[get put], http_callback: nil, environment: 'production',
2626
custom_url: 'https://connect.squareup.com', access_token: nil,
27-
bearer_auth_credentials: nil, square_version: '2025-01-23',
27+
bearer_auth_credentials: nil, square_version: '2025-02-20',
2828
user_agent_detail: '', additional_headers: {}
2929
)
3030

square.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'square.rb'
3-
s.version = '41.0.0.20250123'
3+
s.version = '41.2.0.20250220'
44
s.summary = 'square'
55
s.description = ''
66
s.authors = ['Square Developer Platform']

test/api/test_refunds_api.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@ def test_test_list_payment_refunds()
2222
location_id = nil
2323
status = nil
2424
source_type = nil
25+
updated_at_begin_time = nil
26+
updated_at_end_time = nil
27+
sort_field = nil
2528

2629
# Perform the API call through the SDK function
27-
result = @controller.list_payment_refunds(begin_time: begin_time, end_time: end_time, sort_order: sort_order, cursor: cursor, location_id: location_id, status: status, source_type: source_type)
30+
result = @controller.list_payment_refunds(begin_time: begin_time, end_time: end_time, sort_order: sort_order, cursor: cursor, location_id: location_id, status: status, source_type: source_type, updated_at_begin_time: updated_at_begin_time, updated_at_end_time: updated_at_end_time, sort_field: sort_field)
2831

2932
# Test response code
3033
assert_equal(200, @response_catcher.response.status_code)

0 commit comments

Comments
 (0)