adyen-ruby-api-library 10.3.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -1
  3. data/.github/workflows/codeql.yml +1 -1
  4. data/.github/workflows/release.yml +3 -2
  5. data/.github/workflows/ruby.yml +1 -1
  6. data/.github/workflows/rubygems_release.yml +1 -1
  7. data/Gemfile +1 -1
  8. data/README.md +4 -10
  9. data/VERSION +1 -1
  10. data/lib/adyen/client.rb +61 -15
  11. data/lib/adyen/errors.rb +8 -6
  12. data/lib/adyen/services/{balanceControlService.rb → balanceControl/balance_control_api.rb} +5 -4
  13. data/lib/adyen/services/balanceControl.rb +24 -0
  14. data/lib/adyen/services/balancePlatform/authorized_card_users_api.rb +56 -0
  15. data/lib/adyen/services/balancePlatform/balances_api.rb +2 -2
  16. data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +20 -0
  17. data/lib/adyen/services/balancePlatform/transfer_limits_balance_account_level_api.rb +76 -0
  18. data/lib/adyen/services/balancePlatform/transfer_limits_balance_platform_level_api.rb +56 -0
  19. data/lib/adyen/services/balancePlatform.rb +15 -0
  20. data/lib/adyen/services/binLookup/bin_lookup_api.rb +36 -0
  21. data/lib/adyen/services/binLookup.rb +8 -21
  22. data/lib/adyen/services/checkout/donations_api.rb +1 -1
  23. data/lib/adyen/services/checkout/utility_api.rb +10 -0
  24. data/lib/adyen/services/dataProtection/data_protection_api.rb +26 -0
  25. data/lib/adyen/services/dataProtection.rb +8 -11
  26. data/lib/adyen/services/disputes/disputes_api.rb +66 -0
  27. data/lib/adyen/services/disputes.rb +8 -51
  28. data/lib/adyen/services/legalEntityManagement.rb +1 -1
  29. data/lib/adyen/services/management/split_configuration_merchant_level_api.rb +7 -7
  30. data/lib/adyen/services/openBanking/account_verification_api.rb +36 -0
  31. data/lib/adyen/services/openBanking.rb +24 -0
  32. data/lib/adyen/services/payment/modifications_api.rb +98 -0
  33. data/lib/adyen/services/payment/payments_api.rb +66 -0
  34. data/lib/adyen/services/payment.rb +11 -131
  35. data/lib/adyen/services/paymentsApp/payments_app_api.rb +66 -0
  36. data/lib/adyen/services/paymentsApp.rb +8 -51
  37. data/lib/adyen/services/posMobile/pos_mobile_api.rb +26 -0
  38. data/lib/adyen/services/posMobile.rb +8 -11
  39. data/lib/adyen/services/recurring/recurring_api.rb +80 -0
  40. data/lib/adyen/services/recurring.rb +8 -61
  41. data/lib/adyen/services/sessionAuthentication/session_authentication_api.rb +1 -1
  42. data/lib/adyen/services/storedValue/stored_value_api.rb +76 -0
  43. data/lib/adyen/services/storedValue.rb +8 -61
  44. data/lib/adyen/version.rb +1 -1
  45. data/lib/adyen-ruby-api-library.rb +4 -1
  46. data/spec/balance_control_spec.rb +7 -5
  47. data/spec/balance_platform_spec.rb +344 -63
  48. data/spec/bin_lookup_spec.rb +4 -3
  49. data/spec/client_spec.rb +120 -3
  50. data/spec/data_protection_spec.rb +1 -1
  51. data/spec/disputes_spec.rb +2 -1
  52. data/spec/mocks/requests/BalancePlatform/create_transfer_limit.json +14 -0
  53. data/spec/mocks/requests/BalancePlatform/create_webhook_setting.json +16 -0
  54. data/spec/mocks/requests/OpenBanking/create_account_verification_routes.json +6 -0
  55. data/spec/mocks/requests/SessionAuthentication/create_authentication_session.json +16 -0
  56. data/spec/mocks/responses/BalancePlatform/create_transfer_limit.json +16 -0
  57. data/spec/mocks/responses/BalancePlatform/create_webhook_setting.json +17 -0
  58. data/spec/mocks/responses/BalancePlatform/get_all_authorised_card_users.json +6 -0
  59. data/spec/mocks/responses/BalancePlatform/get_all_webhook_settings.json +38 -0
  60. data/spec/mocks/responses/BalancePlatform/get_specific_transfer_limit.json +17 -0
  61. data/spec/mocks/responses/BalancePlatform/get_transfer_limits.json +38 -0
  62. data/spec/mocks/responses/OpenBanking/create_account_verification_routes.json +11 -0
  63. data/spec/mocks/responses/OpenBanking/get_account_verification_report.json +30 -0
  64. data/spec/mocks/responses/SessionAuthentication/create_authentication_session.json +4 -0
  65. data/spec/open_banking_spec.rb +68 -0
  66. data/spec/payments_spec.rb +1 -1
  67. data/spec/recurring_spec.rb +1 -1
  68. data/spec/session_authentication_spec.rb +40 -0
  69. data/spec/stored_value_spec.rb +1 -1
  70. data/templates/api.mustache +1 -1
  71. metadata +33 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c9dcac3a9a17688cad88c6466c0e9bf555c2fb68f6f17fe1a81145ee39769d9
4
- data.tar.gz: 7ac74b1fd3abce0e78d9a9e27a80128f196f13fe351e16893162de54afde1f8a
3
+ metadata.gz: 4f7ba37ee06a22e3d1f014c6f5db4e64a9953a1b09e3486b343520464cacef8a
4
+ data.tar.gz: 42dcac0cf673d4136551db350fa75c19041349499f8d2d401f13f6367f0e6dc4
5
5
  SHA512:
6
- metadata.gz: dfd9dd3890fedccfa1a74dfd9417475bf9cf4346a45afa35690f199df0af3a6ece03f777f1900c27e71cd40cd1ff641cb96655ad916cb5e6bf3d0395dc2509cb
7
- data.tar.gz: 6ebd1db6b15dc8f3d21325555fde69df8d003141eeccac68db1e99b5cdbc29e8b43d592f68039ade223717334548ca23daef054a91c1f76b69fe0490ec34c7f8
6
+ metadata.gz: c21b9c1a93ffa502019fec7db2fcdcf6b7d8e2bea6b0acd3974a93274deef99db442027fc2a9477d9fbe69e27c726b01edd4f02adb376cc61ec25c77317d9823
7
+ data.tar.gz: f45339daac6e469bdd429ea87eb14e5adf25bf43fee4441c60ad2d70d41fbf8b6713ba9aba715bac0195bed10322c5eded6cf6ea98fb52da4968b5da919bc8e6
data/.github/CODEOWNERS CHANGED
@@ -1 +1 @@
1
- * @Adyen/developer-relations
1
+ * @Adyen/developer-relations @Adyen/api-library-maintainers
@@ -20,7 +20,7 @@ jobs:
20
20
 
21
21
  steps:
22
22
  - name: Checkout
23
- uses: actions/checkout@v4
23
+ uses: actions/checkout@v5
24
24
 
25
25
  - name: Initialize CodeQL
26
26
  uses: github/codeql-action/init@v3
@@ -22,14 +22,15 @@ on:
22
22
 
23
23
  jobs:
24
24
  release:
25
+ if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
25
26
  permissions:
26
27
  contents: write
27
28
  pull-requests: write
28
29
  runs-on: ubuntu-latest
29
30
  steps:
30
- - uses: actions/checkout@v4
31
+ - uses: actions/checkout@v5
31
32
  - name: Prepare the next main release
32
- uses: Adyen/release-automation-action@v1.3.1
33
+ uses: Adyen/release-automation-action@v1.4.0
33
34
  with:
34
35
  token: ${{ secrets.ADYEN_AUTOMATION_BOT_ACCESS_TOKEN }}
35
36
  develop-branch: main
@@ -12,7 +12,7 @@ jobs:
12
12
  ruby: [2.7, '3.0', 3.1, 3.2, head]
13
13
  runs-on: ${{ matrix.os }}
14
14
  steps:
15
- - uses: actions/checkout@v4
15
+ - uses: actions/checkout@v5
16
16
  - uses: ruby/setup-ruby@v1
17
17
  with:
18
18
  ruby-version: ${{ matrix.ruby }}
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
 
11
11
  steps:
12
- - uses: actions/checkout@v4
12
+ - uses: actions/checkout@v5
13
13
  - name: Release Gem on RubyGems
14
14
  if: contains(github.ref, 'refs/tags/v')
15
15
  uses: cadwallion/publish-rubygems-action@v1.1.0
data/Gemfile CHANGED
@@ -4,7 +4,7 @@ source 'https://rubygems.org'
4
4
 
5
5
  ruby '>= 2.7.0'
6
6
 
7
- gem 'faraday'
7
+ gem 'faraday', '2.8.1'
8
8
 
9
9
  gem 'activesupport', group: :development
10
10
  gem 'bundler', group: :development
data/README.md CHANGED
@@ -13,8 +13,10 @@ This library supports the following:
13
13
  | [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) |
14
14
  | [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) |
15
15
  | [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) |
18
20
  | [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) |
19
21
  | [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) |
20
22
  | [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({
89
91
  })
90
92
  ~~~~
91
93
 
92
- - Change API Version
93
- ~~~~ruby
94
- adyen.checkout.version = 69
95
- ~~~~
96
-
97
94
  ### Example integration
98
95
 
99
96
  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"
231
228
 
232
229
  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).
233
230
 
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
-
237
231
  ## Contributing
238
232
 
239
233
  We encourage you to contribute to this repository, so everyone can benefit from new features, bug fixes, and any other improvements.
data/VERSION CHANGED
@@ -1,2 +1,2 @@
1
- 10.3.0
1
+ 11.0.0
2
2
 
data/lib/adyen/client.rb CHANGED
@@ -32,7 +32,18 @@ module Adyen
32
32
  end
33
33
  @mock_service_url_base = mock_service_url_base || "http://localhost:#{mock_port}"
34
34
  @live_url_prefix = live_url_prefix
35
- @connection_options = connection_options || Faraday::ConnectionOptions.new
35
+ if RUBY_VERSION >= '3.2'
36
+ # set default timeouts
37
+ @connection_options = connection_options || Faraday::ConnectionOptions.new(
38
+ request: Faraday::RequestOptions.new(
39
+ open_timeout: 30,
40
+ timeout: 60
41
+ )
42
+ )
43
+ else
44
+ @connection_options = connection_options || Faraday::ConnectionOptions.new
45
+ end
46
+
36
47
  @terminal_region = terminal_region
37
48
  end
38
49
 
@@ -65,7 +76,7 @@ module Adyen
65
76
  when 'Account', 'Fund', 'Notification', 'Hop'
66
77
  url = "https://cal-#{@env}.adyen.com/cal/services/#{service}"
67
78
  supports_live_url_prefix = false
68
- when 'Recurring', 'Payment', 'Payout', 'BinLookup', 'StoredValue', 'BalanceControlService'
79
+ when 'Recurring', 'Payment', 'Payout', 'BinLookup', 'StoredValue', 'BalanceControl'
69
80
  url = "https://pal-#{@env}.adyen.com/pal/servlet/#{service}"
70
81
  supports_live_url_prefix = true
71
82
  when 'PosTerminalManagement'
@@ -102,8 +113,7 @@ module Adyen
102
113
 
103
114
  if @live_url_prefix.nil? && (@env == :live) && supports_live_url_prefix
104
115
  raise ArgumentError,
105
- "Please set Client.live_url_prefix to the portion \
106
- of your merchant-specific URL prior to '-[service]-live.adyenpayments.com'"
116
+ "Please set Client.live_url_prefix to the portion \n of your merchant-specific URL prior to '-[service]-live.adyenpayments.com'"
107
117
  end
108
118
 
109
119
  if @env == :live && supports_live_url_prefix
@@ -204,13 +214,21 @@ module Adyen
204
214
  end
205
215
  # check for API errors
206
216
  case response.status
207
- when 401
208
- raise Adyen::AuthenticationError.new(
209
- 'Invalid API authentication; https://docs.adyen.com/user-management/how-to-get-the-api-key', request_data
210
- )
211
- when 403
212
- raise Adyen::PermissionError.new('Missing user permissions; https://docs.adyen.com/user-management/user-roles',
213
- request_data, response.body)
217
+ when 400
218
+ full_message = build_error_message(response.body, 'Invalid format or fields')
219
+ raise Adyen::FormatError.new(full_message, request_data, response.body)
220
+ when 401
221
+ full_message = build_error_message(response.body, 'Authentication error')
222
+ raise Adyen::AuthenticationError.new(full_message, request_data)
223
+ when 403
224
+ full_message = build_error_message(response.body, 'Authorisation error')
225
+ raise Adyen::PermissionError.new(full_message, request_data, response.body)
226
+ when 422
227
+ full_message = build_error_message(response.body, 'Validation error')
228
+ raise Adyen::ValidationError.new(full_message, request_data, response.body)
229
+ when 500..599
230
+ full_message = build_error_message(response.body, 'Internal server error')
231
+ raise Adyen::ServerError.new(full_message, request_data, response.body)
214
232
  end
215
233
 
216
234
  # delete has no response.body (unless it throws an error)
@@ -281,10 +299,6 @@ module Adyen
281
299
  @stored_value ||= Adyen::StoredValue.new(self)
282
300
  end
283
301
 
284
- def balance_control_service
285
- @balance_control_service ||= Adyen::BalanceControlService.new(self)
286
- end
287
-
288
302
  def terminal_cloud_api
289
303
  @terminal_cloud_api ||= Adyen::TerminalCloudAPI.new(self)
290
304
  end
@@ -293,6 +307,19 @@ module Adyen
293
307
  @pos_mobile ||= Adyen::PosMobile.new(self)
294
308
  end
295
309
 
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
+
296
323
  private
297
324
 
298
325
  def auth_header(auth_type, faraday)
@@ -335,6 +362,25 @@ module Adyen
335
362
  'Checkout service requires API-key or oauth_token'
336
363
  end
337
364
  end
365
+
366
+ # build the error message from the response payload
367
+ def build_error_message(response_body, default_message)
368
+ full_message = default_message
369
+ begin
370
+ error_details = response_body
371
+ # check different attributes to support both RFC 7807 and legacy models
372
+ message = error_details[:detail] || error_details[:message]
373
+ error_code = error_details[:errorCode]
374
+ if message && error_code
375
+ full_message = "#{message} ErrorCode: #{error_code}"
376
+ elsif message
377
+ full_message = message
378
+ end
379
+ rescue JSON::ParserError
380
+ # If the body isn't valid JSON, we fall back to the default message
381
+ end
382
+ full_message
383
+ end
338
384
  end
339
385
  end
340
386
  # rubocop:enable all
data/lib/adyen/errors.rb CHANGED
@@ -79,7 +79,15 @@ module Adyen
79
79
  end
80
80
  end
81
81
 
82
+ # when JSON payload is invalid
82
83
  class FormatError < AdyenError
84
+ def initialize(msg, request, response)
85
+ super(request, response, msg, 400)
86
+ end
87
+ end
88
+
89
+ # when JSON payload cannot be processed (violates business rules)
90
+ class ValidationError < AdyenError
83
91
  def initialize(msg, request, response)
84
92
  super(request, response, msg, 422)
85
93
  end
@@ -97,12 +105,6 @@ module Adyen
97
105
  end
98
106
  end
99
107
 
100
- class ValidationError < AdyenError
101
- def initialize(msg, request)
102
- super(request, nil, msg, nil)
103
- end
104
- end
105
-
106
108
  # catchall for errors which don't have more specific classes
107
109
  class APIError < AdyenError
108
110
  def initialize(msg, request, response, code)
@@ -1,19 +1,20 @@
1
- require_relative './service'
1
+ require_relative '../service'
2
2
  module Adyen
3
3
 
4
4
  # NOTE: This class is auto generated by OpenAPI Generator
5
5
  # Ref: https://openapi-generator.tech
6
6
  #
7
7
  # Do not edit the class manually.
8
- class BalanceControlService < Service
8
+ class BalanceControlApi < Service
9
9
  attr_accessor :service, :version
10
10
 
11
- DEFAULT_VERSION = 1
12
11
  def initialize(client, version = DEFAULT_VERSION)
13
- super(client, version, 'BalanceControlService')
12
+ super(client, version, 'BalanceControl')
14
13
  end
15
14
 
16
15
  # Start a balance transfer
16
+ #
17
+ # Deprecated since Adyen Balance Control API v1
17
18
  def balance_transfer(request, headers: {})
18
19
  endpoint = '/balanceTransfer'.gsub(/{.+?}/, '%s')
19
20
  endpoint = endpoint.gsub(%r{^/}, '')
@@ -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
@@ -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 AuthorizedCardUsersApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'BalancePlatform')
13
+ end
14
+
15
+ # Create authorized users for a card.
16
+ 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)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
25
+ # Delete the authorized users for a card.
26
+ 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)
30
+
31
+ action = { method: 'delete', url: endpoint }
32
+ @client.call_adyen_api(@service, action, {}, headers, @version)
33
+ end
34
+
35
+ # Get authorized users for a card.
36
+ 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)
40
+
41
+ action = { method: 'get', url: endpoint }
42
+ @client.call_adyen_api(@service, action, {}, headers, @version)
43
+ end
44
+
45
+ # Update the authorized users for a card.
46
+ 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)
50
+
51
+ action = { method: 'patch', url: endpoint }
52
+ @client.call_adyen_api(@service, action, request, headers, @version)
53
+ end
54
+
55
+ end
56
+ end
@@ -13,7 +13,7 @@ module Adyen
13
13
  end
14
14
 
15
15
  # 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: {})
17
17
  endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings'.gsub(/{.+?}/, '%s')
18
18
  endpoint = endpoint.gsub(%r{^/}, '')
19
19
  endpoint = format(endpoint, balance_platform_id, webhook_id)
@@ -53,7 +53,7 @@ module Adyen
53
53
  end
54
54
 
55
55
  # 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: {})
57
57
  endpoint = '/balancePlatforms/{balancePlatformId}/webhooks/{webhookId}/settings/{settingId}'.gsub(/{.+?}/, '%s')
58
58
  endpoint = endpoint.gsub(%r{^/}, '')
59
59
  endpoint = format(endpoint, balance_platform_id, webhook_id, setting_id)
@@ -12,6 +12,16 @@ module Adyen
12
12
  super(client, version, 'BalancePlatform')
13
13
  end
14
14
 
15
+ # Create network token provisioning data
16
+ def create_network_token_provisioning_data(request, id, headers: {})
17
+ endpoint = '/paymentInstruments/{id}/networkTokenActivationData'.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
+
15
25
  # Create a payment instrument
16
26
  def create_payment_instrument(request, headers: {})
17
27
  endpoint = '/paymentInstruments'.gsub(/{.+?}/, '%s')
@@ -32,6 +42,16 @@ module Adyen
32
42
  @client.call_adyen_api(@service, action, {}, headers, @version)
33
43
  end
34
44
 
45
+ # Get network token activation data
46
+ def get_network_token_activation_data(id, headers: {})
47
+ endpoint = '/paymentInstruments/{id}/networkTokenActivationData'.gsub(/{.+?}/, '%s')
48
+ endpoint = endpoint.gsub(%r{^/}, '')
49
+ endpoint = format(endpoint, id)
50
+
51
+ action = { method: 'get', url: endpoint }
52
+ @client.call_adyen_api(@service, action, {}, headers, @version)
53
+ end
54
+
35
55
  # Get the PAN of a payment instrument
36
56
  def get_pan_of_payment_instrument(id, headers: {})
37
57
  endpoint = '/paymentInstruments/{id}/reveal'.gsub(/{.+?}/, '%s')
@@ -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
@@ -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
@@ -1,4 +1,5 @@
1
1
  require_relative 'balancePlatform/account_holders_api'
2
+ require_relative 'balancePlatform/authorized_card_users_api'
2
3
  require_relative 'balancePlatform/balance_accounts_api'
3
4
  require_relative 'balancePlatform/balances_api'
4
5
  require_relative 'balancePlatform/bank_account_validation_api'
@@ -12,6 +13,8 @@ require_relative 'balancePlatform/payment_instrument_groups_api'
12
13
  require_relative 'balancePlatform/payment_instruments_api'
13
14
  require_relative 'balancePlatform/platform_api'
14
15
  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'
15
18
  require_relative 'balancePlatform/transfer_routes_api'
16
19
 
17
20
  module Adyen
@@ -34,6 +37,10 @@ module Adyen
34
37
  @account_holders_api ||= Adyen::AccountHoldersApi.new(@client, @version)
35
38
  end
36
39
 
40
+ def authorized_card_users_api
41
+ @authorized_card_users_api ||= Adyen::AuthorizedCardUsersApi.new(@client, @version)
42
+ end
43
+
37
44
  def balance_accounts_api
38
45
  @balance_accounts_api ||= Adyen::BalanceAccountsApi.new(@client, @version)
39
46
  end
@@ -86,6 +93,14 @@ module Adyen
86
93
  @transaction_rules_api ||= Adyen::TransactionRulesApi.new(@client, @version)
87
94
  end
88
95
 
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
+
89
104
  def transfer_routes_api
90
105
  @transfer_routes_api ||= Adyen::TransferRoutesApi.new(@client, @version)
91
106
  end
@@ -0,0 +1,36 @@
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 BinLookupApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'BinLookup')
13
+ end
14
+
15
+ # Check if 3D Secure is available
16
+ def get3ds_availability(request, headers: {})
17
+ endpoint = '/get3dsAvailability'.gsub(/{.+?}/, '%s')
18
+ endpoint = endpoint.gsub(%r{^/}, '')
19
+ endpoint = format(endpoint)
20
+
21
+ action = { method: 'post', url: endpoint }
22
+ @client.call_adyen_api(@service, action, request, headers, @version)
23
+ end
24
+
25
+ # Get a fees cost estimate
26
+ def get_cost_estimate(request, headers: {})
27
+ endpoint = '/getCostEstimate'.gsub(/{.+?}/, '%s')
28
+ endpoint = endpoint.gsub(%r{^/}, '')
29
+ endpoint = format(endpoint)
30
+
31
+ action = { method: 'post', url: endpoint }
32
+ @client.call_adyen_api(@service, action, request, headers, @version)
33
+ end
34
+
35
+ end
36
+ end