Skip to content

Commit 6393be1

Browse files
[balanceplatform] Automated update from Adyen/adyen-openapi@3550ecd
1 parent 60ccdbd commit 6393be1

22 files changed

Lines changed: 86 additions & 252 deletions

lib/adyen/services/balancePlatform/account_holders_api.rb

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,69 +14,55 @@ def initialize(client, version = DEFAULT_VERSION)
1414

1515
# Create an account holder
1616
def create_account_holder(request, headers: {})
17-
endpoint = '/accountHolders'.gsub(/{.+?}/, '%s')
18-
endpoint = endpoint.gsub(%r{^/}, '')
19-
endpoint = format(endpoint)
17+
endpoint = build_endpoint('/accountHolders')
2018

2119
action = { method: 'post', url: endpoint }
2220
@client.call_adyen_api(@service, action, request, headers, @version)
2321
end
2422

2523
# Get an account holder
2624
def get_account_holder(id, headers: {})
27-
endpoint = '/accountHolders/{id}'.gsub(/{.+?}/, '%s')
28-
endpoint = endpoint.gsub(%r{^/}, '')
29-
endpoint = format(endpoint, id)
25+
endpoint = build_endpoint('/accountHolders/{id}', id)
3026

3127
action = { method: 'get', url: endpoint }
3228
@client.call_adyen_api(@service, action, {}, headers, @version)
3329
end
3430

3531
# Get all balance accounts of an account holder
3632
def get_all_balance_accounts_of_account_holder(id, headers: {}, query_params: {})
37-
endpoint = '/accountHolders/{id}/balanceAccounts'.gsub(/{.+?}/, '%s')
38-
endpoint = endpoint.gsub(%r{^/}, '')
39-
endpoint = format(endpoint, id)
33+
endpoint = build_endpoint('/accountHolders/{id}/balanceAccounts', id)
4034
endpoint += create_query_string(query_params)
4135
action = { method: 'get', url: endpoint }
4236
@client.call_adyen_api(@service, action, {}, headers, @version)
4337
end
4438

4539
# Get all transaction rules for an account holder
4640
def get_all_transaction_rules_for_account_holder(id, headers: {})
47-
endpoint = '/accountHolders/{id}/transactionRules'.gsub(/{.+?}/, '%s')
48-
endpoint = endpoint.gsub(%r{^/}, '')
49-
endpoint = format(endpoint, id)
41+
endpoint = build_endpoint('/accountHolders/{id}/transactionRules', id)
5042

5143
action = { method: 'get', url: endpoint }
5244
@client.call_adyen_api(@service, action, {}, headers, @version)
5345
end
5446

5547
# Get a tax form
5648
def get_tax_form(id, headers: {}, query_params: {})
57-
endpoint = '/accountHolders/{id}/taxForms'.gsub(/{.+?}/, '%s')
58-
endpoint = endpoint.gsub(%r{^/}, '')
59-
endpoint = format(endpoint, id)
49+
endpoint = build_endpoint('/accountHolders/{id}/taxForms', id)
6050
endpoint += create_query_string(query_params)
6151
action = { method: 'get', url: endpoint }
6252
@client.call_adyen_api(@service, action, {}, headers, @version)
6353
end
6454

6555
# Get summary of tax forms for an account holder
6656
def get_tax_form_summary(id, headers: {}, query_params: {})
67-
endpoint = '/accountHolders/{id}/taxFormSummary'.gsub(/{.+?}/, '%s')
68-
endpoint = endpoint.gsub(%r{^/}, '')
69-
endpoint = format(endpoint, id)
57+
endpoint = build_endpoint('/accountHolders/{id}/taxFormSummary', id)
7058
endpoint += create_query_string(query_params)
7159
action = { method: 'get', url: endpoint }
7260
@client.call_adyen_api(@service, action, {}, headers, @version)
7361
end
7462

7563
# Update an account holder
7664
def update_account_holder(request, id, headers: {})
77-
endpoint = '/accountHolders/{id}'.gsub(/{.+?}/, '%s')
78-
endpoint = endpoint.gsub(%r{^/}, '')
79-
endpoint = format(endpoint, id)
65+
endpoint = build_endpoint('/accountHolders/{id}', id)
8066

8167
action = { method: 'patch', url: endpoint }
8268
@client.call_adyen_api(@service, action, request, headers, @version)

lib/adyen/services/balancePlatform/authorized_card_users_api.rb

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,31 @@ def initialize(client, version = DEFAULT_VERSION)
1414

1515
# Create authorized users for a card.
1616
def create_authorised_card_users(request, payment_instrument_id, headers: {})
17-
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
18-
endpoint = endpoint.gsub(%r{^/}, '')
19-
endpoint = format(endpoint, payment_instrument_id)
17+
endpoint = build_endpoint('/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers', payment_instrument_id)
2018

2119
action = { method: 'post', url: endpoint }
2220
@client.call_adyen_api(@service, action, request, headers, @version)
2321
end
2422

2523
# Delete the authorized users for a card.
2624
def delete_authorised_card_users(payment_instrument_id, headers: {})
27-
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
28-
endpoint = endpoint.gsub(%r{^/}, '')
29-
endpoint = format(endpoint, payment_instrument_id)
25+
endpoint = build_endpoint('/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers', payment_instrument_id)
3026

3127
action = { method: 'delete', url: endpoint }
3228
@client.call_adyen_api(@service, action, {}, headers, @version)
3329
end
3430

3531
# Get authorized users for a card.
3632
def get_all_authorised_card_users(payment_instrument_id, headers: {})
37-
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
38-
endpoint = endpoint.gsub(%r{^/}, '')
39-
endpoint = format(endpoint, payment_instrument_id)
33+
endpoint = build_endpoint('/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers', payment_instrument_id)
4034

4135
action = { method: 'get', url: endpoint }
4236
@client.call_adyen_api(@service, action, {}, headers, @version)
4337
end
4438

4539
# Update the authorized users for a card.
4640
def update_authorised_card_users(request, payment_instrument_id, headers: {})
47-
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
48-
endpoint = endpoint.gsub(%r{^/}, '')
49-
endpoint = format(endpoint, payment_instrument_id)
41+
endpoint = build_endpoint('/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers', payment_instrument_id)
5042

5143
action = { method: 'patch', url: endpoint }
5244
@client.call_adyen_api(@service, action, request, headers, @version)

lib/adyen/services/balancePlatform/balance_accounts_api.rb

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -14,99 +14,79 @@ def initialize(client, version = DEFAULT_VERSION)
1414

1515
# Create a balance account
1616
def create_balance_account(request, headers: {})
17-
endpoint = '/balanceAccounts'.gsub(/{.+?}/, '%s')
18-
endpoint = endpoint.gsub(%r{^/}, '')
19-
endpoint = format(endpoint)
17+
endpoint = build_endpoint('/balanceAccounts')
2018

2119
action = { method: 'post', url: endpoint }
2220
@client.call_adyen_api(@service, action, request, headers, @version)
2321
end
2422

2523
# Create a sweep
2624
def create_sweep(request, balance_account_id, headers: {})
27-
endpoint = '/balanceAccounts/{balanceAccountId}/sweeps'.gsub(/{.+?}/, '%s')
28-
endpoint = endpoint.gsub(%r{^/}, '')
29-
endpoint = format(endpoint, balance_account_id)
25+
endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps', balance_account_id)
3026

3127
action = { method: 'post', url: endpoint }
3228
@client.call_adyen_api(@service, action, request, headers, @version)
3329
end
3430

3531
# Delete a sweep
3632
def delete_sweep(balance_account_id, sweep_id, headers: {})
37-
endpoint = '/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}'.gsub(/{.+?}/, '%s')
38-
endpoint = endpoint.gsub(%r{^/}, '')
39-
endpoint = format(endpoint, balance_account_id, sweep_id)
33+
endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}', balance_account_id, sweep_id)
4034

4135
action = { method: 'delete', url: endpoint }
4236
@client.call_adyen_api(@service, action, {}, headers, @version)
4337
end
4438

4539
# Get all sweeps for a balance account
4640
def get_all_sweeps_for_balance_account(balance_account_id, headers: {}, query_params: {})
47-
endpoint = '/balanceAccounts/{balanceAccountId}/sweeps'.gsub(/{.+?}/, '%s')
48-
endpoint = endpoint.gsub(%r{^/}, '')
49-
endpoint = format(endpoint, balance_account_id)
41+
endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps', balance_account_id)
5042
endpoint += create_query_string(query_params)
5143
action = { method: 'get', url: endpoint }
5244
@client.call_adyen_api(@service, action, {}, headers, @version)
5345
end
5446

5547
# Get all transaction rules for a balance account
5648
def get_all_transaction_rules_for_balance_account(id, headers: {})
57-
endpoint = '/balanceAccounts/{id}/transactionRules'.gsub(/{.+?}/, '%s')
58-
endpoint = endpoint.gsub(%r{^/}, '')
59-
endpoint = format(endpoint, id)
49+
endpoint = build_endpoint('/balanceAccounts/{id}/transactionRules', id)
6050

6151
action = { method: 'get', url: endpoint }
6252
@client.call_adyen_api(@service, action, {}, headers, @version)
6353
end
6454

6555
# Get a balance account
6656
def get_balance_account(id, headers: {})
67-
endpoint = '/balanceAccounts/{id}'.gsub(/{.+?}/, '%s')
68-
endpoint = endpoint.gsub(%r{^/}, '')
69-
endpoint = format(endpoint, id)
57+
endpoint = build_endpoint('/balanceAccounts/{id}', id)
7058

7159
action = { method: 'get', url: endpoint }
7260
@client.call_adyen_api(@service, action, {}, headers, @version)
7361
end
7462

7563
# Get payment instruments linked to a balance account
7664
def get_payment_instruments_linked_to_balance_account(id, headers: {}, query_params: {})
77-
endpoint = '/balanceAccounts/{id}/paymentInstruments'.gsub(/{.+?}/, '%s')
78-
endpoint = endpoint.gsub(%r{^/}, '')
79-
endpoint = format(endpoint, id)
65+
endpoint = build_endpoint('/balanceAccounts/{id}/paymentInstruments', id)
8066
endpoint += create_query_string(query_params)
8167
action = { method: 'get', url: endpoint }
8268
@client.call_adyen_api(@service, action, {}, headers, @version)
8369
end
8470

8571
# Get a sweep
8672
def get_sweep(balance_account_id, sweep_id, headers: {})
87-
endpoint = '/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}'.gsub(/{.+?}/, '%s')
88-
endpoint = endpoint.gsub(%r{^/}, '')
89-
endpoint = format(endpoint, balance_account_id, sweep_id)
73+
endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}', balance_account_id, sweep_id)
9074

9175
action = { method: 'get', url: endpoint }
9276
@client.call_adyen_api(@service, action, {}, headers, @version)
9377
end
9478

9579
# Update a balance account
9680
def update_balance_account(request, id, headers: {})
97-
endpoint = '/balanceAccounts/{id}'.gsub(/{.+?}/, '%s')
98-
endpoint = endpoint.gsub(%r{^/}, '')
99-
endpoint = format(endpoint, id)
81+
endpoint = build_endpoint('/balanceAccounts/{id}', id)
10082

10183
action = { method: 'patch', url: endpoint }
10284
@client.call_adyen_api(@service, action, request, headers, @version)
10385
end
10486

10587
# Update a sweep
10688
def update_sweep(request, balance_account_id, sweep_id, headers: {})
107-
endpoint = '/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}'.gsub(/{.+?}/, '%s')
108-
endpoint = endpoint.gsub(%r{^/}, '')
109-
endpoint = format(endpoint, balance_account_id, sweep_id)
89+
endpoint = build_endpoint('/balanceAccounts/{balanceAccountId}/sweeps/{sweepId}', balance_account_id, sweep_id)
11090

11191
action = { method: 'patch', url: endpoint }
11292
@client.call_adyen_api(@service, action, request, headers, @version)

lib/adyen/services/balancePlatform/balances_api.rb

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,49 +14,39 @@ def initialize(client, version = DEFAULT_VERSION)
1414

1515
# Create a balance webhook setting
1616
def create_webhook_setting(request, balance_platform_id, webhook_id, headers: {})
17-
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings'.gsub(/{.+?}/, '%s')
18-
endpoint = endpoint.gsub(%r{^/}, '')
19-
endpoint = format(endpoint, balance_platform_id, webhook_id)
17+
endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings', balance_platform_id, webhook_id)
2018

2119
action = { method: 'post', url: endpoint }
2220
@client.call_adyen_api(@service, action, request, headers, @version)
2321
end
2422

2523
# Delete a balance webhook setting by id
2624
def delete_webhook_setting(balance_platform_id, webhook_id, setting_id, headers: {})
27-
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'.gsub(/{.+?}/, '%s')
28-
endpoint = endpoint.gsub(%r{^/}, '')
29-
endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
25+
endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}', balance_platform_id, webhook_id, setting_id)
3026

3127
action = { method: 'delete', url: endpoint }
3228
@client.call_adyen_api(@service, action, {}, headers, @version)
3329
end
3430

3531
# Get all balance webhook settings
3632
def get_all_webhook_settings(balance_platform_id, webhook_id, headers: {})
37-
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings'.gsub(/{.+?}/, '%s')
38-
endpoint = endpoint.gsub(%r{^/}, '')
39-
endpoint = format(endpoint, balance_platform_id, webhook_id)
33+
endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings', balance_platform_id, webhook_id)
4034

4135
action = { method: 'get', url: endpoint }
4236
@client.call_adyen_api(@service, action, {}, headers, @version)
4337
end
4438

4539
# Get a balance webhook setting by id
4640
def get_webhook_setting(balance_platform_id, webhook_id, setting_id, headers: {})
47-
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'.gsub(/{.+?}/, '%s')
48-
endpoint = endpoint.gsub(%r{^/}, '')
49-
endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
41+
endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}', balance_platform_id, webhook_id, setting_id)
5042

5143
action = { method: 'get', url: endpoint }
5244
@client.call_adyen_api(@service, action, {}, headers, @version)
5345
end
5446

5547
# Update a balance webhook setting by id
5648
def update_webhook_setting(request, balance_platform_id, webhook_id, setting_id, headers: {})
57-
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'.gsub(/{.+?}/, '%s')
58-
endpoint = endpoint.gsub(%r{^/}, '')
59-
endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
49+
endpoint = build_endpoint('/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}', balance_platform_id, webhook_id, setting_id)
6050

6151
action = { method: 'patch', url: endpoint }
6252
@client.call_adyen_api(@service, action, request, headers, @version)

lib/adyen/services/balancePlatform/bank_account_validation_api.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ def initialize(client, version = DEFAULT_VERSION)
1414

1515
# Validate a bank account
1616
def validate_bank_account_identification(request, headers: {})
17-
endpoint = '/validateBankAccountIdentification'.gsub(/{.+?}/, '%s')
18-
endpoint = endpoint.gsub(%r{^/}, '')
19-
endpoint = format(endpoint)
17+
endpoint = build_endpoint('/validateBankAccountIdentification')
2018

2119
action = { method: 'post', url: endpoint }
2220
@client.call_adyen_api(@service, action, request, headers, @version)

lib/adyen/services/balancePlatform/card_orders_api.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,15 @@ def initialize(client, version = DEFAULT_VERSION)
1414

1515
# Get card order items
1616
def get_card_order_items(id, headers: {}, query_params: {})
17-
endpoint = '/cardorders/{id}/items'.gsub(/{.+?}/, '%s')
18-
endpoint = endpoint.gsub(%r{^/}, '')
19-
endpoint = format(endpoint, id)
17+
endpoint = build_endpoint('/cardorders/{id}/items', id)
2018
endpoint += create_query_string(query_params)
2119
action = { method: 'get', url: endpoint }
2220
@client.call_adyen_api(@service, action, {}, headers, @version)
2321
end
2422

2523
# Get a list of card orders
2624
def list_card_orders(headers: {}, query_params: {})
27-
endpoint = '/cardorders'.gsub(/{.+?}/, '%s')
28-
endpoint = endpoint.gsub(%r{^/}, '')
29-
endpoint = format(endpoint)
25+
endpoint = build_endpoint('/cardorders')
3026
endpoint += create_query_string(query_params)
3127
action = { method: 'get', url: endpoint }
3228
@client.call_adyen_api(@service, action, {}, headers, @version)

lib/adyen/services/balancePlatform/direct_debit_mandates_api.rb

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,39 +14,31 @@ def initialize(client, version = DEFAULT_VERSION)
1414

1515
# Cancel a mandate
1616
def cancel_mandate(mandate_id, headers: {})
17-
endpoint = '/mandates/{mandateId}/cancel'.gsub(/{.+?}/, '%s')
18-
endpoint = endpoint.gsub(%r{^/}, '')
19-
endpoint = format(endpoint, mandate_id)
17+
endpoint = build_endpoint('/mandates/{mandateId}/cancel', mandate_id)
2018

2119
action = { method: 'post', url: endpoint }
2220
@client.call_adyen_api(@service, action, {}, headers, @version)
2321
end
2422

2523
# Get a list of mandates
2624
def get_list_of_mandates(headers: {}, query_params: {})
27-
endpoint = '/mandates'.gsub(/{.+?}/, '%s')
28-
endpoint = endpoint.gsub(%r{^/}, '')
29-
endpoint = format(endpoint)
25+
endpoint = build_endpoint('/mandates')
3026
endpoint += create_query_string(query_params)
3127
action = { method: 'get', url: endpoint }
3228
@client.call_adyen_api(@service, action, {}, headers, @version)
3329
end
3430

3531
# Get a specific mandate
3632
def get_mandate_by_id(mandate_id, headers: {})
37-
endpoint = '/mandates/{mandateId}'.gsub(/{.+?}/, '%s')
38-
endpoint = endpoint.gsub(%r{^/}, '')
39-
endpoint = format(endpoint, mandate_id)
33+
endpoint = build_endpoint('/mandates/{mandateId}', mandate_id)
4034

4135
action = { method: 'get', url: endpoint }
4236
@client.call_adyen_api(@service, action, {}, headers, @version)
4337
end
4438

4539
# Amend a mandate
4640
def update_mandate(request, mandate_id, headers: {})
47-
endpoint = '/mandates/{mandateId}'.gsub(/{.+?}/, '%s')
48-
endpoint = endpoint.gsub(%r{^/}, '')
49-
endpoint = format(endpoint, mandate_id)
41+
endpoint = build_endpoint('/mandates/{mandateId}', mandate_id)
5042

5143
action = { method: 'patch', url: endpoint }
5244
@client.call_adyen_api(@service, action, request, headers, @version)

lib/adyen/services/balancePlatform/grant_accounts_api.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ def initialize(client, version = DEFAULT_VERSION)
1717
# Deprecated since Configuration API v2
1818
# Use the `/grantAccounts/{id}` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grantAccounts/(id)) instead.
1919
def get_grant_account(id, headers: {})
20-
endpoint = '/grantAccounts/{id}'.gsub(/{.+?}/, '%s')
21-
endpoint = endpoint.gsub(%r{^/}, '')
22-
endpoint = format(endpoint, id)
20+
endpoint = build_endpoint('/grantAccounts/{id}', id)
2321

2422
action = { method: 'get', url: endpoint }
2523
@client.call_adyen_api(@service, action, {}, headers, @version)

lib/adyen/services/balancePlatform/grant_offers_api.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ def initialize(client, version = DEFAULT_VERSION)
1717
# Deprecated since Configuration API v2
1818
# Use the `/grantOffers` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grantOffers) instead.
1919
def get_all_available_grant_offers(headers: {}, query_params: {})
20-
endpoint = '/grantOffers'.gsub(/{.+?}/, '%s')
21-
endpoint = endpoint.gsub(%r{^/}, '')
22-
endpoint = format(endpoint)
20+
endpoint = build_endpoint('/grantOffers')
2321
endpoint += create_query_string(query_params)
2422
action = { method: 'get', url: endpoint }
2523
@client.call_adyen_api(@service, action, {}, headers, @version)
@@ -30,9 +28,7 @@ def get_all_available_grant_offers(headers: {}, query_params: {})
3028
# Deprecated since Configuration API v2
3129
# Use the `/grantOffers/{id}` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grantOffers/(id)) instead.
3230
def get_grant_offer(grant_offer_id, headers: {})
33-
endpoint = '/grantOffers/{grantOfferId}'.gsub(/{.+?}/, '%s')
34-
endpoint = endpoint.gsub(%r{^/}, '')
35-
endpoint = format(endpoint, grant_offer_id)
31+
endpoint = build_endpoint('/grantOffers/{grantOfferId}', grant_offer_id)
3632

3733
action = { method: 'get', url: endpoint }
3834
@client.call_adyen_api(@service, action, {}, headers, @version)

0 commit comments

Comments
 (0)