Skip to content

Commit 430a71a

Browse files
committed
Update ordering.
1 parent 3988181 commit 430a71a

File tree

3 files changed

+39
-37
lines changed

3 files changed

+39
-37
lines changed

doc/api/refunds.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ 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,
3431
sort_order=None,
3532
cursor=None,
3633
location_id=None,
3734
status=None,
3835
source_type=None,
39-
limit=None)
36+
limit=None,
37+
updated_at_begin_time=None,
38+
updated_at_end_time=None,
39+
sort_field=None)
4040
```
4141

4242
## Parameters
@@ -45,15 +45,15 @@ def list_payment_refunds(self,
4545
| --- | --- | --- | --- |
4646
| `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. |
4747
| `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 `begin_time`. |
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> |
5148
| `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). |
5249
| `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). |
5350
| `location_id` | `str` | Query, Optional | Limit results to the location supplied. By default, results are returned<br>for all locations associated with the seller. |
5451
| `status` | `str` | 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. |
5552
| `source_type` | `str` | 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. |
5653
| `limit` | `int` | 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 |
54+
| `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`. |
55+
| `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. |
56+
| `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> |
5757

5858
## Response Type
5959

square/api/refunds_api.py

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# -*- coding: utf-8 -*-
22

3-
from square.api_helper import APIHelper
4-
from square.http.api_response import ApiResponse
5-
from square.api.base_api import BaseApi
3+
from apimatic_core.authentication.multiple.single_auth import Single
64
from apimatic_core.request_builder import RequestBuilder
75
from apimatic_core.response_handler import ResponseHandler
86
from apimatic_core.types.parameter import Parameter
7+
8+
from square.api.base_api import BaseApi
9+
from square.api_helper import APIHelper
10+
from square.http.api_response import ApiResponse
911
from square.http.http_method_enum import HttpMethodEnum
10-
from apimatic_core.authentication.multiple.single_auth import Single
1112

1213

1314
class RefundsApi(BaseApi):
@@ -45,18 +46,6 @@ def list_payment_refunds(self,
4546
retrieve each `PaymentRefund` for, in RFC 3339 format. The
4647
range is determined using the `created_at` field for each
4748
`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`.
6049
sort_order (str, optional): The order in which results are listed
6150
by `PaymentRefund.created_at`: - `ASC` - Oldest to newest. -
6251
`DESC` - Newest to oldest (default).
@@ -86,6 +75,18 @@ def list_payment_refunds(self,
8675
results than the specified limit on a given page. If the
8776
supplied value is greater than 100, no more than 100 results
8877
are returned. Default: 100
78+
updated_at_begin_time (str, optional): Indicates the start of the time range
79+
to retrieve each `PaymentRefund` for, in RFC 3339 format.
80+
The range is determined using the `updated_at` field for each
81+
`PaymentRefund`. Default: if omitted, the time range starts at
82+
`beginTime`.
83+
updated_at_end_time (str, optional): Indicates the end of the time range to
84+
retrieve each `PaymentRefund` for, in RFC 3339 format. The
85+
range is determined using the `updated_at` field for each
86+
`PaymentRefund`. Default: The current time.
87+
sort_field (str, optional): The field used to sort results by. The default
88+
is `CREATED_AT`. Current values include `CREATED_AT` and
89+
`UPDATED_AT`.
8990
9091
Returns:
9192
ApiResponse: An object with the response value as well as other
@@ -109,15 +110,6 @@ def list_payment_refunds(self,
109110
.query_param(Parameter()
110111
.key('end_time')
111112
.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))
121113
.query_param(Parameter()
122114
.key('sort_order')
123115
.value(sort_order))
@@ -136,6 +128,15 @@ def list_payment_refunds(self,
136128
.query_param(Parameter()
137129
.key('limit')
138130
.value(limit))
131+
.query_param(Parameter()
132+
.key('updated_at_begin_time')
133+
.value(updated_at_begin_time))
134+
.query_param(Parameter()
135+
.key('updated_at_end_time')
136+
.value(updated_at_end_time))
137+
.query_param(Parameter()
138+
.key('sort_field')
139+
.value(sort_field))
139140
.header_param(Parameter()
140141
.key('accept')
141142
.value('application/json'))

tests/api/test_refunds_api.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# -*- coding: utf-8 -*-
22

3-
from tests.test_helper import TestHelper
43
from tests.api.api_test_base import ApiTestBase
4+
from tests.test_helper import TestHelper
5+
56

67
class RefundsApiTests(ApiTestBase):
78

@@ -18,17 +19,17 @@ def test_test_list_payment_refunds(self):
1819
# Parameters for the API call
1920
begin_time = None
2021
end_time = None
21-
updated_at_begin_time = None
22-
updated_at_end_time = None
23-
sort_field = None
2422
sort_order = None
2523
cursor = None
2624
location_id = None
2725
status = None
2826
source_type = None
27+
updated_at_begin_time = None
28+
updated_at_end_time = None
29+
sort_field = None
2930

3031
# Perform the API call through the SDK function
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)
32+
result = self.controller.list_payment_refunds(begin_time, end_time, sort_order, cursor, location_id, status, source_type, updated_at_begin_time, updated_at_end_time, sort_field)
3233

3334
# Test response code
3435
self.assertEquals(self.response_catcher.response.status_code, 200)

0 commit comments

Comments
 (0)