Skip to content

Commit 54dbdd6

Browse files
authored
Merge pull request #313 from Adyen/openapi-generator-v7
OpenAPI Generator v7
2 parents a511b74 + 4de48c5 commit 54dbdd6

File tree

59 files changed

+1585
-511
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1585
-511
lines changed

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ This library supports the following:
1313
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | v71 | Our latest integration for accepting online payments. | [CheckoutAPI](lib/adyen/services/checkout.rb) |
1414
| [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | v2 | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | [BalancePlatform](lib/adyen/services/balancePlatform.rb) |
1515
| [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | v1 | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | [DataProtection](lib/adyen/services/dataProtection.rb) |
16-
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | v3 | Manage legal entities that contain information required for verification. | [LegalEntityManagement](lib/adyen/services/legalEntityManagement.rb) |
17-
| [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | v3 | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](lib/adyen/services/management.rb) |
16+
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | v4 | Manage legal entities that contain information required for verification. | [LegalEntityManagement](lib/adyen/services/legalEntityManagement.rb) |
17+
| [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | v3 | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](lib/adyen/services/management.rb) |
18+
| [OpenBanking API](https://docs.adyen.com/api-explorer/open-banking/1/overview) | v1 | Securely share financial data and services with third parties. | [OpenBanking](lib/adyen/services/openBanking.rb) |
19+
| [SessionAuthentication API](https://docs.adyen.com/api-explorer/sessionauthentication/1/overview) | v1 | The Session authentication API enables you to create and manage the JSON Web Tokens (JWT) required for integrating components. | [SessionAuthentication](lib/adyen/services/sessionAuthentication.rb) |
1820
| [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | v68 | Our classic integration for online payments. | [Classic Integration API](lib/adyen/services/payment.rb) |
1921
| [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | v68 | Endpoints for sending funds to your customers. | [Payout](lib/adyen/services/payout.rb) |
2022
| [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | ~~v1~~ | ~~Endpoints for managing your point-of-sale payment terminals.~~ ‼️ **Deprecated**: use instead the [Management API](https://docs.adyen.com/api-explorer/Management/latest/overview) for the management of your terminal fleet. | ~~[TerminalManagement](lib/adyen/services/posTerminalManagement.rb)~~ || [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | v68 | Endpoints for managing saved payment details. | [Recurring](lib/adyen/services/recurring.rb) |
@@ -89,11 +91,6 @@ response = adyen.checkout.payments_api.payments({
8991
})
9092
~~~~
9193

92-
- Change API Version
93-
~~~~ruby
94-
adyen.checkout.version = 69
95-
~~~~
96-
9794
### Example integration
9895

9996
For a closer look at how our Ruby library works, clone our [example integration](https://github.com/adyen-examples/adyen-rails-online-payments). This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
@@ -231,9 +228,6 @@ adyen.oauth_token = "oauth_token"
231228

232229
The APIs available to use through OAuth in this library depend on the [OAuth Scopes](https://docs.adyen.com/development-resources/oauth/scopes/) defined when [Registering your OAuth client](https://docs.adyen.com/development-resources/oauth/integration/#step-1-register-your-client).
233230

234-
## Feedback
235-
We value your input! Help us enhance our API Libraries and improve the integration experience by providing your feedback. Please take a moment to fill out [our feedback form](https://forms.gle/A4EERrR6CWgKWe5r9) to share your thoughts, suggestions or ideas.
236-
237231
## Contributing
238232

239233
We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements.

lib/adyen-ruby-api-library.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
require_relative 'adyen/services/transfers'
1919
require_relative 'adyen/services/management'
2020
require_relative 'adyen/services/storedValue'
21-
require_relative 'adyen/services/balanceControlService'
2221
require_relative 'adyen/services/terminalCloudAPI'
2322
require_relative 'adyen/services/posMobile'
23+
require_relative 'adyen/services/openBanking'
24+
require_relative 'adyen/services/sessionAuthentication'
25+
require_relative 'adyen/services/balanceControl'
26+

lib/adyen/client.rb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def service_url_base(service)
7676
when 'Account', 'Fund', 'Notification', 'Hop'
7777
url = "https://cal-#{@env}.adyen.com/cal/services/#{service}"
7878
supports_live_url_prefix = false
79-
when 'Recurring', 'Payment', 'Payout', 'BinLookup', 'StoredValue', 'BalanceControlService'
79+
when 'Recurring', 'Payment', 'Payout', 'BinLookup', 'StoredValue', 'BalanceControl'
8080
url = "https://pal-#{@env}.adyen.com/pal/servlet/#{service}"
8181
supports_live_url_prefix = true
8282
when 'PosTerminalManagement'
@@ -299,10 +299,6 @@ def stored_value
299299
@stored_value ||= Adyen::StoredValue.new(self)
300300
end
301301

302-
def balance_control_service
303-
@balance_control_service ||= Adyen::BalanceControlService.new(self)
304-
end
305-
306302
def terminal_cloud_api
307303
@terminal_cloud_api ||= Adyen::TerminalCloudAPI.new(self)
308304
end
@@ -311,6 +307,19 @@ def pos_mobile
311307
@pos_mobile ||= Adyen::PosMobile.new(self)
312308
end
313309

310+
def open_banking
311+
@open_banking ||= Adyen::OpenBanking.new(self)
312+
end
313+
314+
def session_authentication
315+
@open_banking ||= Adyen::SessionAuthentication.new(self)
316+
end
317+
318+
def balance_control
319+
@balance_control ||= Adyen::BalanceControl.new(self)
320+
end
321+
322+
314323
private
315324

316325
def auth_header(auth_type, faraday)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
require_relative 'balanceControl/balance_control_api'
2+
3+
module Adyen
4+
5+
# NOTE: This class is auto generated by OpenAPI Generator
6+
# Ref: https://openapi-generator.tech
7+
#
8+
# Do not edit the class manually.
9+
class BalanceControl
10+
attr_accessor :service, :version
11+
12+
DEFAULT_VERSION = 1
13+
def initialize(client, version = DEFAULT_VERSION)
14+
@service = 'BalanceControl'
15+
@client = client
16+
@version = version
17+
end
18+
19+
def balance_control_api
20+
@balance_control_api ||= Adyen::BalanceControlApi.new(@client, @version)
21+
end
22+
23+
end
24+
end

lib/adyen/services/balanceControlService.rb renamed to lib/adyen/services/balanceControl/balance_control_api.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
1-
require_relative './service'
1+
require_relative '../service'
22
module Adyen
33

44
# NOTE: This class is auto generated by OpenAPI Generator
55
# Ref: https://openapi-generator.tech
66
#
77
# Do not edit the class manually.
8-
class BalanceControlService < Service
8+
class BalanceControlApi < Service
99
attr_accessor :service, :version
1010

11-
DEFAULT_VERSION = 1
1211
def initialize(client, version = DEFAULT_VERSION)
13-
super(client, version, 'BalanceControlService')
12+
super(client, version, 'BalanceControl')
1413
end
1514

1615
# Start a balance transfer
16+
#
17+
# Deprecated since Adyen Balance Control API v1
1718
def balance_transfer(request, headers: {})
1819
endpoint = '/balanceTransfer'.gsub(/{.+?}/, '%s')
1920
endpoint = endpoint.gsub(%r{^/}, '')

lib/adyen/services/balancePlatform.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
require_relative 'balancePlatform/payment_instruments_api'
1414
require_relative 'balancePlatform/platform_api'
1515
require_relative 'balancePlatform/transaction_rules_api'
16+
require_relative 'balancePlatform/transfer_limits_balance_account_level_api'
17+
require_relative 'balancePlatform/transfer_limits_balance_platform_level_api'
1618
require_relative 'balancePlatform/transfer_routes_api'
1719

1820
module Adyen
@@ -91,6 +93,14 @@ def transaction_rules_api
9193
@transaction_rules_api ||= Adyen::TransactionRulesApi.new(@client, @version)
9294
end
9395

96+
def transfer_limits_balance_account_level_api
97+
@transfer_limits_balance_account_level_api ||= Adyen::TransferLimitsBalanceAccountLevelApi.new(@client, @version)
98+
end
99+
100+
def transfer_limits_balance_platform_level_api
101+
@transfer_limits_balance_platform_level_api ||= Adyen::TransferLimitsBalancePlatformLevelApi.new(@client, @version)
102+
end
103+
94104
def transfer_routes_api
95105
@transfer_routes_api ||= Adyen::TransferRoutesApi.new(@client, @version)
96106
end

lib/adyen/services/balancePlatform/authorized_card_users_api.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(client, version = DEFAULT_VERSION)
1313
end
1414

1515
# Create authorized users for a card.
16-
def create_authorised_card_users(request, payment_instrument_id, authorised_card_users, headers: {})
16+
def create_authorised_card_users(request, payment_instrument_id, headers: {})
1717
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
1818
endpoint = endpoint.gsub(%r{^/}, '')
1919
endpoint = format(endpoint, payment_instrument_id)
@@ -43,7 +43,7 @@ def get_all_authorised_card_users(payment_instrument_id, headers: {})
4343
end
4444

4545
# Update the authorized users for a card.
46-
def update_authorised_card_users(request, payment_instrument_id, authorised_card_users, headers: {})
46+
def update_authorised_card_users(request, payment_instrument_id, headers: {})
4747
endpoint = '/paymentInstruments/{paymentInstrumentId}/authorisedCardUsers'.gsub(/{.+?}/, '%s')
4848
endpoint = endpoint.gsub(%r{^/}, '')
4949
endpoint = format(endpoint, payment_instrument_id)

lib/adyen/services/balancePlatform/balances_api.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(client, version = DEFAULT_VERSION)
1313
end
1414

1515
# Create a balance webhook setting
16-
def create_webhook_setting(request, balance_platform_id, webhook_id, balance_webhook_setting_info, headers: {})
16+
def create_webhook_setting(request, balance_platform_id, webhook_id, headers: {})
1717
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings'.gsub(/{.+?}/, '%s')
1818
endpoint = endpoint.gsub(%r{^/}, '')
1919
endpoint = format(endpoint, balance_platform_id, webhook_id)
@@ -53,7 +53,7 @@ def get_webhook_setting(balance_platform_id, webhook_id, setting_id, headers: {}
5353
end
5454

5555
# Update a balance webhook setting by id
56-
def update_webhook_setting(request, balance_platform_id, webhook_id, setting_id, balance_webhook_setting_info_update, headers: {})
56+
def update_webhook_setting(request, balance_platform_id, webhook_id, setting_id, headers: {})
5757
endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'.gsub(/{.+?}/, '%s')
5858
endpoint = endpoint.gsub(%r{^/}, '')
5959
endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
require_relative '../service'
2+
module Adyen
3+
4+
# NOTE: This class is auto generated by OpenAPI Generator
5+
# Ref: https://openapi-generator.tech
6+
#
7+
# Do not edit the class manually.
8+
class TransferLimitsBalanceAccountLevelApi < Service
9+
attr_accessor :service, :version
10+
11+
def initialize(client, version = DEFAULT_VERSION)
12+
super(client, version, 'BalancePlatform')
13+
end
14+
15+
# Approve pending transfer limits
16+
def approve_pending_transfer_limits(request, id, headers: {})
17+
endpoint = '/balanceAccounts/{id}/transferLimits/approve'.gsub(/{.+?}/, '%s')
18+
endpoint = endpoint.gsub(%r{^/}, '')
19+
endpoint = format(endpoint, id)
20+
21+
action = { method: 'post', url: endpoint }
22+
@client.call_adyen_api(@service, action, request, headers, @version)
23+
end
24+
25+
# Create a transfer limit
26+
def create_transfer_limit(request, id, headers: {})
27+
endpoint = '/balanceAccounts/{id}/transferLimits'.gsub(/{.+?}/, '%s')
28+
endpoint = endpoint.gsub(%r{^/}, '')
29+
endpoint = format(endpoint, id)
30+
31+
action = { method: 'post', url: endpoint }
32+
@client.call_adyen_api(@service, action, request, headers, @version)
33+
end
34+
35+
# Delete a scheduled or pending transfer limit
36+
def delete_pending_transfer_limit(id, transfer_limit_id, headers: {})
37+
endpoint = '/balanceAccounts/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
38+
endpoint = endpoint.gsub(%r{^/}, '')
39+
endpoint = format(endpoint, id, transfer_limit_id)
40+
41+
action = { method: 'delete', url: endpoint }
42+
@client.call_adyen_api(@service, action, {}, headers, @version)
43+
end
44+
45+
# Get all current transfer limits
46+
def get_current_transfer_limits(id, headers: {}, query_params: {})
47+
endpoint = '/balanceAccounts/{id}/transferLimits/current'.gsub(/{.+?}/, '%s')
48+
endpoint = endpoint.gsub(%r{^/}, '')
49+
endpoint = format(endpoint, id)
50+
endpoint += create_query_string(query_params)
51+
action = { method: 'get', url: endpoint }
52+
@client.call_adyen_api(@service, action, {}, headers, @version)
53+
end
54+
55+
# Get the details of a transfer limit
56+
def get_specific_transfer_limit(id, transfer_limit_id, headers: {})
57+
endpoint = '/balanceAccounts/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
58+
endpoint = endpoint.gsub(%r{^/}, '')
59+
endpoint = format(endpoint, id, transfer_limit_id)
60+
61+
action = { method: 'get', url: endpoint }
62+
@client.call_adyen_api(@service, action, {}, headers, @version)
63+
end
64+
65+
# Filter and view the transfer limits
66+
def get_transfer_limits(id, headers: {}, query_params: {})
67+
endpoint = '/balanceAccounts/{id}/transferLimits'.gsub(/{.+?}/, '%s')
68+
endpoint = endpoint.gsub(%r{^/}, '')
69+
endpoint = format(endpoint, id)
70+
endpoint += create_query_string(query_params)
71+
action = { method: 'get', url: endpoint }
72+
@client.call_adyen_api(@service, action, {}, headers, @version)
73+
end
74+
75+
end
76+
end
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
require_relative '../service'
2+
module Adyen
3+
4+
# NOTE: This class is auto generated by OpenAPI Generator
5+
# Ref: https://openapi-generator.tech
6+
#
7+
# Do not edit the class manually.
8+
class TransferLimitsBalancePlatformLevelApi < Service
9+
attr_accessor :service, :version
10+
11+
def initialize(client, version = DEFAULT_VERSION)
12+
super(client, version, 'BalancePlatform')
13+
end
14+
15+
# Create a transfer limit
16+
def create_transfer_limit(request, id, headers: {})
17+
endpoint = '/balancePlatforms/{id}/transferLimits'.gsub(/{.+?}/, '%s')
18+
endpoint = endpoint.gsub(%r{^/}, '')
19+
endpoint = format(endpoint, id)
20+
21+
action = { method: 'post', url: endpoint }
22+
@client.call_adyen_api(@service, action, request, headers, @version)
23+
end
24+
25+
# Delete a scheduled or pending transfer limit
26+
def delete_pending_transfer_limit(id, transfer_limit_id, headers: {})
27+
endpoint = '/balancePlatforms/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
28+
endpoint = endpoint.gsub(%r{^/}, '')
29+
endpoint = format(endpoint, id, transfer_limit_id)
30+
31+
action = { method: 'delete', url: endpoint }
32+
@client.call_adyen_api(@service, action, {}, headers, @version)
33+
end
34+
35+
# Get the details of a transfer limit
36+
def get_specific_transfer_limit(id, transfer_limit_id, headers: {})
37+
endpoint = '/balancePlatforms/{id}/transferLimits/{transferLimitId}'.gsub(/{.+?}/, '%s')
38+
endpoint = endpoint.gsub(%r{^/}, '')
39+
endpoint = format(endpoint, id, transfer_limit_id)
40+
41+
action = { method: 'get', url: endpoint }
42+
@client.call_adyen_api(@service, action, {}, headers, @version)
43+
end
44+
45+
# Filter and view the transfer limits
46+
def get_transfer_limits(id, headers: {}, query_params: {})
47+
endpoint = '/balancePlatforms/{id}/transferLimits'.gsub(/{.+?}/, '%s')
48+
endpoint = endpoint.gsub(%r{^/}, '')
49+
endpoint = format(endpoint, id)
50+
endpoint += create_query_string(query_params)
51+
action = { method: 'get', url: endpoint }
52+
@client.call_adyen_api(@service, action, {}, headers, @version)
53+
end
54+
55+
end
56+
end

0 commit comments

Comments
 (0)