Skip to content

Commit 4368bff

Browse files
committed
Add additional updatedAtBeginTime, updatedAtEndTime, and sortField query parameters to listPaymentRefuns endpoint.
1 parent ead4876 commit 4368bff

File tree

8 files changed

+43
-10
lines changed

8 files changed

+43
-10
lines changed

doc/api/refunds.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ The maximum results per page is 100.
2828
def list_payment_refunds(self,
2929
begin_time=None,
3030
end_time=None,
31+
updated_at_begin_time=None,
32+
updated_at_end_time=None,
33+
sort_field=None,
3134
sort_order=None,
3235
cursor=None,
3336
location_id=None,
@@ -42,6 +45,9 @@ def list_payment_refunds(self,
4245
| --- | --- | --- | --- |
4346
| `begin_time` | `str` | 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 `created_at` field for each `PaymentRefund`.<br><br>Default: The current time minus one year. |
4447
| `end_time` | `str` | 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 `created_at` field for each `PaymentRefund`.<br><br>Default: The current time. |
48+
| `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 `beginTime`. |
49+
| `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. |
50+
| `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> |
4551
| `sort_order` | `str` | Query, Optional | The order in which results are listed by `PaymentRefund.created_at`:<br><br>- `ASC` - Oldest to newest.<br>- `DESC` - Newest to oldest (default). |
4652
| `cursor` | `str` | Query, 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). |
4753
| `location_id` | `str` | Query, Optional | Limit results to the location supplied. By default, results are returned<br>for all locations associated with the seller. |

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` | `str` | Square Connect API versions<br>*Default*: `'2025-01-23'` |
8+
| `square_version` | `str` | Square Connect API versions<br>*Default*: `'2025-02-20'` |
99
| `custom_url` | `str` | 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
| `http_client_instance` | `HttpClient` | The Http Client passed from the sdk user for making requests |
@@ -24,7 +24,7 @@ The API client can be initialized as follows:
2424

2525
```python
2626
client = Client(
27-
square_version='2025-01-23',
27+
square_version='2025-02-20',
2828
bearer_auth_credentials=BearerAuthCredentials(
2929
access_token='AccessToken'
3030
),
@@ -53,7 +53,7 @@ from square.http.auth.o_auth_2 import BearerAuthCredentials
5353
from square.client import Client
5454

5555
client = Client(
56-
square_version='2025-01-23',
56+
square_version='2025-02-20',
5757
bearer_auth_credentials=BearerAuthCredentials(
5858
access_token='AccessToken'
5959
),

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = ["setuptools>=61.0"]
44
[project]
55
name = "squareup"
66
description = "Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management."
7-
version = "40.0.0.220250123"
7+
version = "40.1.0.220250220"
88
readme = "README.md"
99
requires-python = ">=3.7"
1010
authors = [{name = "Square Developer Platform", email = "[email protected]"}]

square/api/base_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class BaseApi(object):
2222

2323
@staticmethod
2424
def user_agent():
25-
return 'Square-Python-SDK/40.0.0.220250123 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
25+
return 'Square-Python-SDK/40.1.0.220250220 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}'
2626

2727
@staticmethod
2828
def user_agent_parameters():

square/api/refunds_api.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ def __init__(self, config):
1919
def list_payment_refunds(self,
2020
begin_time=None,
2121
end_time=None,
22+
updated_at_begin_time=None,
23+
updated_at_end_time=None,
24+
sort_field=None,
2225
sort_order=None,
2326
cursor=None,
2427
location_id=None,
@@ -42,6 +45,18 @@ def list_payment_refunds(self,
4245
retrieve each `PaymentRefund` for, in RFC 3339 format. The
4346
range is determined using the `created_at` field for each
4447
`PaymentRefund`. Default: The current time.
48+
updated_at_begin_time (str, optional): Indicates the start of the time range
49+
to retrieve each `PaymentRefund` for, in RFC 3339 format.
50+
The range is determined using the `updated_at` field for each
51+
`PaymentRefund`. Default: if omitted, the time range starts at
52+
`beginTime`.
53+
updated_at_end_time (str, optional): Indicates the end of the time range to
54+
retrieve each `PaymentRefund` for, in RFC 3339 format. The
55+
range is determined using the `updated_at` field for each
56+
`PaymentRefund`. Default: The current time.
57+
sort_field (str, optional): The field used to sort results by. The default
58+
is `CREATED_AT`. Current values include `CREATED_AT` and
59+
`UPDATED_AT`.
4560
sort_order (str, optional): The order in which results are listed
4661
by `PaymentRefund.created_at`: - `ASC` - Oldest to newest. -
4762
`DESC` - Newest to oldest (default).
@@ -94,6 +109,15 @@ def list_payment_refunds(self,
94109
.query_param(Parameter()
95110
.key('end_time')
96111
.value(end_time))
112+
.query_param(Parameter()
113+
.key('updated_at_begin_time')
114+
.value(updated_at_begin_time))
115+
.query_param(Parameter()
116+
.key('updated_at_end_time')
117+
.value(updated_at_end_time))
118+
.query_param(Parameter()
119+
.key('sort_field')
120+
.value(sort_field))
97121
.query_param(Parameter()
98122
.key('sort_order')
99123
.value(sort_order))

square/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
class Client(object):
5656
@staticmethod
5757
def sdk_version():
58-
return '40.0.0.220250123'
58+
return '40.1.0.220250220'
5959

6060
@staticmethod
6161
def square_version():
62-
return '2025-01-23'
62+
return '2025-02-20'
6363

6464
def user_agent_detail(self):
6565
return self.config.user_agent_detail
@@ -238,7 +238,7 @@ def __init__(self, http_client_instance=None,
238238
retry_statuses=None, retry_methods=None,
239239
environment='production',
240240
custom_url='https://connect.squareup.com', access_token=None,
241-
bearer_auth_credentials=None, square_version='2025-01-23',
241+
bearer_auth_credentials=None, square_version='2025-02-20',
242242
additional_headers={}, user_agent_detail='', config=None):
243243
self.config = config or Configuration(
244244
http_client_instance=http_client_instance,

square/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, http_client_instance=None,
4545
retry_statuses=None, retry_methods=None,
4646
environment='production',
4747
custom_url='https://connect.squareup.com', access_token=None,
48-
bearer_auth_credentials=None, square_version='2025-01-23',
48+
bearer_auth_credentials=None, square_version='2025-02-20',
4949
additional_headers={}, user_agent_detail=''):
5050
if retry_methods is None:
5151
retry_methods = ['GET', 'PUT']

tests/api/test_refunds_api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ def test_test_list_payment_refunds(self):
1818
# Parameters for the API call
1919
begin_time = None
2020
end_time = None
21+
updated_at_begin_time = None
22+
updated_at_end_time = None
23+
sort_field = None
2124
sort_order = None
2225
cursor = None
2326
location_id = None
2427
status = None
2528
source_type = None
2629

2730
# Perform the API call through the SDK function
28-
result = self.controller.list_payment_refunds(begin_time, end_time, sort_order, cursor, location_id, status, source_type)
31+
result = self.controller.list_payment_refunds(begin_time, end_time, updated_at_begin_time, updated_at_end_time, sort_field, sort_order, cursor, location_id, status, source_type)
2932

3033
# Test response code
3134
self.assertEquals(self.response_catcher.response.status_code, 200)

0 commit comments

Comments
 (0)