Skip to content

Commit efd6b54

Browse files
Slavaiamdevice
Slava
andauthored
Add gateway account financial-settings operations (#478)
* Add financial-settings operations * Update openapi/components/schemas/GatewayAccounts/FinancialSettings.yaml Co-authored-by: Alexander <[email protected]> * Fix required fields * Rename fields Co-authored-by: Alexander <[email protected]>
1 parent ef80087 commit efd6b54

9 files changed

+242
-0
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 4
11+
trim_trailing_whitespace = true
12+
max_line_length = 120
13+
14+
[*.{diff,md}]
15+
trim_trailing_whitespace = false
16+
17+
[*.{html,js,rb,scss,xml,yml,yaml,json,feature}]
18+
indent_size = 2

openapi/components/schemas/Bips.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
type: number
2+
description: Basis points - 100 bips = 1%, 1 bips = 0.01%.
3+
format: integer
4+
minimum: 0
5+
maximum: 100000
6+
example: 100
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
type: string
2+
description: >
3+
This follows our standard filter format.
4+
See the [filter guide](https://api-reference.rebilly.com/#section/Using-filter-with-collections) for more options and examples
5+
about this format.
6+
example: amount:1..100;currency:USD;bin:411111,444433
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
type: object
2+
description: Financial settings.
3+
properties:
4+
riskReserveSettings:
5+
description: The settings to setup funds reserves before settlement.
6+
type: array
7+
items:
8+
type: object
9+
required:
10+
- filter
11+
- bips
12+
- period
13+
properties:
14+
filter:
15+
description: A filter based on the transaction's properties which is used to determine when to apply the settings.
16+
minLength: 1
17+
maxLength: 255
18+
example: 'paymentInstrument.method:payment-card'
19+
allOf:
20+
- $ref: ../FilterString.yaml
21+
bips:
22+
$ref: ../Bips.yaml
23+
period:
24+
$ref: RiskReservePeriod.yaml
25+
settlementSettings:
26+
description: The settings to setup settlement accounts.
27+
type: object
28+
required:
29+
- settlementCurrency
30+
- settlementPeriod
31+
properties:
32+
settlementCurrency:
33+
description: The default settlement currency for all transactions.
34+
allOf:
35+
- $ref: ../CurrencyCode.yaml
36+
settlementPeriod:
37+
description: The default settlement period for all transactions.
38+
allOf:
39+
- $ref: SettlementPeriod.yaml
40+
advancedSettings:
41+
description: |
42+
The advanced settings allows to override either default settlement currency, period or both
43+
for the transactions matched a filter.
44+
type: array
45+
items:
46+
type: object
47+
required:
48+
- filter
49+
properties:
50+
filter:
51+
description: A filter based on the transaction's properties which is used to determine when to apply the settings.
52+
minLength: 1
53+
maxLength: 255
54+
example: 'currency:EUR,GBP'
55+
allOf:
56+
- $ref: ../FilterString.yaml
57+
settlementCurrency:
58+
$ref: ../CurrencyCode.yaml
59+
settlementPeriod:
60+
$ref: SettlementPeriod.yaml
61+
example:
62+
filter: 'currency:EUR,GBP'
63+
settlementCurrency: "EUR"
64+
settlementPeriod: null
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
type: object
2+
description: The calculation instruction of reserve release time.
3+
discriminator:
4+
propertyName: method
5+
mapping:
6+
date-interval: ../Scheduling/Methods/date-interval.yaml
7+
required:
8+
- method
9+
properties:
10+
method:
11+
type: string
12+
enum:
13+
- date-interval
14+
example:
15+
method: date-interval
16+
unit: days
17+
duration: 180
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
type: object
2+
description: |
3+
Instruction for calculating the settlement time.
4+
5+
This is used in conjunction with the **transaction processed time** to calculate the
6+
time the amount settles.
7+
properties:
8+
method:
9+
type: string
10+
enum:
11+
- date-interval
12+
duration:
13+
type: integer
14+
description: The number of the units.
15+
minimum: 1
16+
unit:
17+
oneOf:
18+
- $ref: ../TimeUnit.yaml
19+
- $ref: ../TimePluralUnit.yaml
20+
anchor:
21+
$ref: SettlementPeriodAnchor.yaml
22+
required:
23+
- method
24+
- duration
25+
- unit
26+
example:
27+
method: "date-interval"
28+
unit: "days"
29+
duration: 14
30+
anchor:
31+
method: "day-of-week"
32+
day: "Wednesday"
33+
week: "next"
34+
time: "08:00:00"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
type: object
2+
description: >
3+
Instruction for calculating the settlement period anchor.
4+
5+
This is used in conjunction with the **transaction processed time** to calculate the
6+
time the amount settles.
7+
discriminator:
8+
propertyName: method
9+
mapping:
10+
day-of-month: ../Scheduling/Methods/day-of-month.yaml
11+
day-of-week: ../Scheduling/Methods/day-of-week.yaml
12+
immediately: ../Scheduling/Methods/immediately.yaml
13+
default:
14+
method: immediately
15+
required:
16+
- method
17+
properties:
18+
method:
19+
type: string
20+
default: immediately
21+
enum:
22+
- immediately
23+
- day-of-month
24+
- day-of-week
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
parameters:
2+
- $ref: ../components/parameters/organizationId.yaml
3+
- $ref: ../components/parameters/resourceId.yaml
4+
get:
5+
tags:
6+
- Gateway Accounts
7+
summary: Retrieve financial settings
8+
operationId: GetGatewayAccountFinancialSettings
9+
x-sdk-operation-name: getFinancialSettings
10+
description: >
11+
Read financial settings of a gateway account.
12+
responses:
13+
'200':
14+
description: The financial settings were retrieved successfully.
15+
headers:
16+
Rate-Limit-Limit:
17+
$ref: ../components/headers/Rate-Limit-Limit.yaml
18+
Rate-Limit-Remaining:
19+
$ref: ../components/headers/Rate-Limit-Remaining.yaml
20+
Rate-Limit-Reset:
21+
$ref: ../components/headers/Rate-Limit-Reset.yaml
22+
content:
23+
application/json:
24+
schema:
25+
$ref: ../components/schemas/GatewayAccounts/FinancialSettings.yaml
26+
'401':
27+
$ref: ../components/responses/Unauthorized.yaml
28+
'403':
29+
$ref: ../components/responses/Forbidden.yaml
30+
'404':
31+
$ref: ../components/responses/NotFound.yaml
32+
33+
put:
34+
tags:
35+
- Gateway Accounts
36+
summary: Set financial settings
37+
operationId: PutGatewayAccountFinancialSettings
38+
x-sdk-operation-name: setFinancialSettings
39+
description: |
40+
Set financial settings of a gateway account.
41+
requestBody:
42+
content:
43+
application/json:
44+
schema:
45+
$ref: ../components/schemas/GatewayAccounts/FinancialSettings.yaml
46+
responses:
47+
'200':
48+
description: Gateway account financial settings were updated.
49+
headers:
50+
Rate-Limit-Limit:
51+
$ref: ../components/headers/Rate-Limit-Limit.yaml
52+
Rate-Limit-Remaining:
53+
$ref: ../components/headers/Rate-Limit-Remaining.yaml
54+
Rate-Limit-Reset:
55+
$ref: ../components/headers/Rate-Limit-Reset.yaml
56+
content:
57+
application/json:
58+
schema:
59+
$ref: ../components/schemas/GatewayAccounts/FinancialSettings.yaml
60+
'401':
61+
$ref: ../components/responses/Unauthorized.yaml
62+
'403':
63+
$ref: ../components/responses/Forbidden.yaml
64+
'404':
65+
$ref: ../components/responses/NotFound.yaml
66+
'422':
67+
description: Invalid data was sent.
68+
content:
69+
application/json:
70+
schema:
71+
$ref: ../components/schemas/InvalidError.yaml

openapi/users.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ paths:
396396
$ref: './paths/gateway-accounts@{id}@timeline@{messageId}.yaml'
397397
'/gateway-accounts/{id}/check-credentials':
398398
$ref: './paths/gateway-accounts@{id}@check-credentials.yaml'
399+
'/gateway-accounts/{id}/financial-settings':
400+
$ref: './paths/gateway-accounts@{id}@financial-settings.yaml'
399401
/grid-segments:
400402
$ref: ./paths/grid-segments.yaml
401403
'/grid-segments/{id}':

0 commit comments

Comments
 (0)