adyen-ruby-api-library 11.1.0 → 11.3.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 (145) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -1
  3. data/.github/workflows/codeql.yml +4 -4
  4. data/.github/workflows/label_new_issues.yml +1 -1
  5. data/.github/workflows/release.yml +2 -2
  6. data/.github/workflows/ruby.yml +11 -3
  7. data/.github/workflows/rubygems_release.yml +2 -2
  8. data/.github/workflows/stale.yml +1 -1
  9. data/AGENTS.md +73 -0
  10. data/README.md +3 -0
  11. data/VERSION +1 -1
  12. data/lib/adyen/client.rb +18 -8
  13. data/lib/adyen/services/balanceControl/balance_control_api.rb +1 -3
  14. data/lib/adyen/services/balancePlatform/account_holders_api.rb +14 -18
  15. data/lib/adyen/services/balancePlatform/authorized_card_users_api.rb +4 -12
  16. data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +10 -30
  17. data/lib/adyen/services/balancePlatform/balances_api.rb +5 -15
  18. data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +1 -3
  19. data/lib/adyen/services/balancePlatform/card_orders_api.rb +2 -6
  20. data/lib/adyen/services/balancePlatform/direct_debit_mandates_api.rb +48 -0
  21. data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +1 -3
  22. data/lib/adyen/services/balancePlatform/grant_offers_api.rb +2 -6
  23. data/lib/adyen/services/balancePlatform/manage_card_pin_api.rb +3 -9
  24. data/lib/adyen/services/balancePlatform/manage_sca_devices_api.rb +6 -18
  25. data/lib/adyen/services/balancePlatform/network_tokens_api.rb +2 -6
  26. data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +3 -9
  27. data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +9 -27
  28. data/lib/adyen/services/balancePlatform/platform_api.rb +3 -9
  29. data/lib/adyen/services/balancePlatform/sca_association_management_api.rb +40 -0
  30. data/lib/adyen/services/balancePlatform/sca_device_management_api.rb +40 -0
  31. data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +4 -12
  32. data/lib/adyen/services/balancePlatform/transfer_limits_balance_account_level_api.rb +6 -18
  33. data/lib/adyen/services/balancePlatform/transfer_limits_balance_platform_level_api.rb +4 -12
  34. data/lib/adyen/services/balancePlatform/transfer_routes_api.rb +1 -3
  35. data/lib/adyen/services/balancePlatform.rb +15 -0
  36. data/lib/adyen/services/binLookup/bin_lookup_api.rb +2 -6
  37. data/lib/adyen/services/capital/dynamic_offers_api.rb +40 -0
  38. data/lib/adyen/services/capital/grant_accounts_api.rb +24 -0
  39. data/lib/adyen/services/capital/grant_offers_api.rb +32 -0
  40. data/lib/adyen/services/capital/grants_api.rb +64 -0
  41. data/lib/adyen/services/capital.rb +39 -0
  42. data/lib/adyen/services/checkout/donations_api.rb +2 -6
  43. data/lib/adyen/services/checkout/modifications_api.rb +6 -18
  44. data/lib/adyen/services/checkout/orders_api.rb +3 -9
  45. data/lib/adyen/services/checkout/payment_links_api.rb +3 -9
  46. data/lib/adyen/services/checkout/payments_api.rb +6 -18
  47. data/lib/adyen/services/checkout/recurring_api.rb +11 -9
  48. data/lib/adyen/services/checkout/utility_api.rb +4 -12
  49. data/lib/adyen/services/dataProtection/data_protection_api.rb +1 -3
  50. data/lib/adyen/services/disputes/disputes_api.rb +5 -15
  51. data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +4 -12
  52. data/lib/adyen/services/legalEntityManagement/documents_api.rb +4 -12
  53. data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +3 -9
  54. data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +7 -21
  55. data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +5 -15
  56. data/lib/adyen/services/legalEntityManagement/tax_e_delivery_consent_api.rb +2 -6
  57. data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +5 -15
  58. data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +4 -12
  59. data/lib/adyen/services/management/account_company_level_api.rb +3 -9
  60. data/lib/adyen/services/management/account_merchant_level_api.rb +4 -12
  61. data/lib/adyen/services/management/account_store_level_api.rb +8 -24
  62. data/lib/adyen/services/management/allowed_origins_company_level_api.rb +4 -12
  63. data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +4 -12
  64. data/lib/adyen/services/management/android_files_company_level_api.rb +6 -18
  65. data/lib/adyen/services/management/api_credentials_company_level_api.rb +4 -12
  66. data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +4 -12
  67. data/lib/adyen/services/management/api_key_company_level_api.rb +1 -3
  68. data/lib/adyen/services/management/api_key_merchant_level_api.rb +1 -3
  69. data/lib/adyen/services/management/client_key_company_level_api.rb +1 -3
  70. data/lib/adyen/services/management/client_key_merchant_level_api.rb +1 -3
  71. data/lib/adyen/services/management/my_api_credential_api.rb +6 -18
  72. data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +6 -18
  73. data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +5 -15
  74. data/lib/adyen/services/management/split_configuration_merchant_level_api.rb +9 -27
  75. data/lib/adyen/services/management/terminal_actions_company_level_api.rb +2 -6
  76. data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +1 -3
  77. data/lib/adyen/services/management/terminal_orders_company_level_api.rb +10 -30
  78. data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +10 -30
  79. data/lib/adyen/services/management/terminal_settings_company_level_api.rb +4 -12
  80. data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +4 -12
  81. data/lib/adyen/services/management/terminal_settings_store_level_api.rb +8 -24
  82. data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +4 -12
  83. data/lib/adyen/services/management/terminals_terminal_level_api.rb +2 -6
  84. data/lib/adyen/services/management/users_company_level_api.rb +4 -12
  85. data/lib/adyen/services/management/users_merchant_level_api.rb +4 -12
  86. data/lib/adyen/services/management/webhooks_company_level_api.rb +7 -21
  87. data/lib/adyen/services/management/webhooks_merchant_level_api.rb +7 -21
  88. data/lib/adyen/services/payment/modifications_api.rb +8 -24
  89. data/lib/adyen/services/payment/payments_api.rb +5 -15
  90. data/lib/adyen/services/paymentsApp/payments_app_api.rb +5 -15
  91. data/lib/adyen/services/payout/initialization_api.rb +3 -9
  92. data/lib/adyen/services/payout/instant_payouts_api.rb +1 -3
  93. data/lib/adyen/services/payout/reviewing_api.rb +2 -6
  94. data/lib/adyen/services/posMobile/pos_mobile_api.rb +1 -3
  95. data/lib/adyen/services/recurring/recurring_api.rb +7 -19
  96. data/lib/adyen/services/recurring.rb +1 -1
  97. data/lib/adyen/services/service.rb +10 -2
  98. data/lib/adyen/services/sessionAuthentication/session_authentication_api.rb +1 -3
  99. data/lib/adyen/services/storedValue/stored_value_api.rb +6 -18
  100. data/lib/adyen/services/transfers/capital_api.rb +3 -9
  101. data/lib/adyen/services/transfers/transactions_api.rb +2 -6
  102. data/lib/adyen/services/transfers/transfers_api.rb +6 -18
  103. data/lib/adyen/utils/hmac_validator.rb +0 -1
  104. data/lib/adyen/version.rb +1 -1
  105. data/lib/adyen-ruby-api-library.rb +1 -0
  106. data/sdk-generation-log/balancecontrol.json +8 -0
  107. data/sdk-generation-log/balanceplatform.json +8 -0
  108. data/sdk-generation-log/binlookup.json +8 -0
  109. data/sdk-generation-log/capital.json +8 -0
  110. data/sdk-generation-log/checkout.json +8 -0
  111. data/sdk-generation-log/dataprotection.json +8 -0
  112. data/sdk-generation-log/disputes.json +8 -0
  113. data/sdk-generation-log/legalentitymanagement.json +8 -0
  114. data/sdk-generation-log/management.json +8 -0
  115. data/sdk-generation-log/payment.json +8 -0
  116. data/sdk-generation-log/paymentsapp.json +8 -0
  117. data/sdk-generation-log/payout.json +8 -0
  118. data/sdk-generation-log/posmobile.json +8 -0
  119. data/sdk-generation-log/recurring.json +8 -0
  120. data/sdk-generation-log/sessionauthentication.json +8 -0
  121. data/sdk-generation-log/storedvalue.json +8 -0
  122. data/sdk-generation-log/transfers.json +8 -0
  123. data/spec/balance_platform_spec.rb +111 -0
  124. data/spec/capital_spec.rb +268 -0
  125. data/spec/client_spec.rb +206 -68
  126. data/spec/mocks/requests/BalancePlatform/update_mandate.json +14 -0
  127. data/spec/mocks/responses/BalancePlatform/get_list_of_mandates.json +19 -0
  128. data/spec/mocks/responses/BalancePlatform/get_mandate_by_id.json +14 -0
  129. data/spec/mocks/responses/BalancePlatform/get_tax_form_summary.json +17 -0
  130. data/spec/mocks/responses/Capital/calculate-preliminary-offer-from-dynamic-offer.json +16 -0
  131. data/spec/mocks/responses/Capital/create-static-offer-from-dynamic-offer.json +9 -0
  132. data/spec/mocks/responses/Capital/get-all-dynamic-offers.json +18 -0
  133. data/spec/mocks/responses/Capital/get-grant-account-success.json +20 -0
  134. data/spec/mocks/responses/Capital/get-grant-disbursement-success.json +26 -0
  135. data/spec/mocks/responses/Capital/get-grant-disbursements-success.json +30 -0
  136. data/spec/mocks/responses/Capital/get-grant-offer-success.json +31 -0
  137. data/spec/mocks/responses/Capital/get-grant-success.json +22 -0
  138. data/spec/mocks/responses/Capital/grant-offers-success.json +19 -0
  139. data/spec/mocks/responses/Capital/grants-success.json +26 -0
  140. data/spec/mocks/responses/Capital/request-grant.json +31 -0
  141. data/spec/mocks/responses/Capital/update-grant-disbursement-success.json +26 -0
  142. data/spec/service_spec.rb +40 -0
  143. data/templates/api-small.mustache +1 -3
  144. data/templates/api.mustache +1 -3
  145. metadata +44 -1
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Change the authorised amount
16
16
  def adjust_authorisation(request, headers: {})
17
- endpoint = '/adjustAuthorisation'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/adjustAuthorisation')
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Cancel an authorisation
26
24
  def cancel(request, headers: {})
27
- endpoint = '/cancel'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/cancel')
30
26
 
31
27
  action = { method: 'post', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Cancel or refund a payment
36
32
  def cancel_or_refund(request, headers: {})
37
- endpoint = '/cancelOrRefund'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/cancelOrRefund')
40
34
 
41
35
  action = { method: 'post', url: endpoint }
42
36
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -44,9 +38,7 @@ module Adyen
44
38
 
45
39
  # Capture an authorisation
46
40
  def capture(request, headers: {})
47
- endpoint = '/capture'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint)
41
+ endpoint = build_endpoint('/capture')
50
42
 
51
43
  action = { method: 'post', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -56,9 +48,7 @@ module Adyen
56
48
  #
57
49
  # Deprecated
58
50
  def donate(request, headers: {})
59
- endpoint = '/donate'.gsub(/{.+?}/, '%s')
60
- endpoint = endpoint.gsub(%r{^/}, '')
61
- endpoint = format(endpoint)
51
+ endpoint = build_endpoint('/donate')
62
52
 
63
53
  action = { method: 'post', url: endpoint }
64
54
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -66,9 +56,7 @@ module Adyen
66
56
 
67
57
  # Refund a captured payment
68
58
  def refund(request, headers: {})
69
- endpoint = '/refund'.gsub(/{.+?}/, '%s')
70
- endpoint = endpoint.gsub(%r{^/}, '')
71
- endpoint = format(endpoint)
59
+ endpoint = build_endpoint('/refund')
72
60
 
73
61
  action = { method: 'post', url: endpoint }
74
62
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -76,9 +64,7 @@ module Adyen
76
64
 
77
65
  # Cancel an authorisation using your reference
78
66
  def technical_cancel(request, headers: {})
79
- endpoint = '/technicalCancel'.gsub(/{.+?}/, '%s')
80
- endpoint = endpoint.gsub(%r{^/}, '')
81
- endpoint = format(endpoint)
67
+ endpoint = build_endpoint('/technicalCancel')
82
68
 
83
69
  action = { method: 'post', url: endpoint }
84
70
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -86,9 +72,7 @@ module Adyen
86
72
 
87
73
  # Cancel an in-person refund
88
74
  def void_pending_refund(request, headers: {})
89
- endpoint = '/voidPendingRefund'.gsub(/{.+?}/, '%s')
90
- endpoint = endpoint.gsub(%r{^/}, '')
91
- endpoint = format(endpoint)
75
+ endpoint = build_endpoint('/voidPendingRefund')
92
76
 
93
77
  action = { method: 'post', url: endpoint }
94
78
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Create an authorisation
16
16
  def authorise(request, headers: {})
17
- endpoint = '/authorise'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/authorise')
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Complete a 3DS authorisation
26
24
  def authorise3d(request, headers: {})
27
- endpoint = '/authorise3d'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/authorise3d')
30
26
 
31
27
  action = { method: 'post', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Complete a 3DS2 authorisation
36
32
  def authorise3ds2(request, headers: {})
37
- endpoint = '/authorise3ds2'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/authorise3ds2')
40
34
 
41
35
  action = { method: 'post', url: endpoint }
42
36
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -44,9 +38,7 @@ module Adyen
44
38
 
45
39
  # Get the 3DS authentication result
46
40
  def get_authentication_result(request, headers: {})
47
- endpoint = '/getAuthenticationResult'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint)
41
+ endpoint = build_endpoint('/getAuthenticationResult')
50
42
 
51
43
  action = { method: 'post', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -54,9 +46,7 @@ module Adyen
54
46
 
55
47
  # Get the 3DS2 authentication result
56
48
  def retrieve3ds2_result(request, headers: {})
57
- endpoint = '/retrieve3ds2Result'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint)
49
+ endpoint = build_endpoint('/retrieve3ds2Result')
60
50
 
61
51
  action = { method: 'post', url: endpoint }
62
52
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Create a boarding token - merchant level
16
16
  def generate_payments_app_boarding_token_for_merchant(request, merchant_id, headers: {})
17
- endpoint = '/merchants/{merchantId}/generatePaymentsAppBoardingToken'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, merchant_id)
17
+ endpoint = build_endpoint('/merchants/{merchantId}/generatePaymentsAppBoardingToken', merchant_id)
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Create a boarding token - store level
26
24
  def generate_payments_app_boarding_token_for_store(request, merchant_id, store_id, headers: {})
27
- endpoint = '/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, merchant_id, store_id)
25
+ endpoint = build_endpoint('/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken', merchant_id, store_id)
30
26
 
31
27
  action = { method: 'post', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get a list of Payments Apps - merchant level
36
32
  def list_payments_app_for_merchant(merchant_id, headers: {}, query_params: {})
37
- endpoint = '/merchants/{merchantId}/paymentsApps'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, merchant_id)
33
+ endpoint = build_endpoint('/merchants/{merchantId}/paymentsApps', merchant_id)
40
34
  endpoint += create_query_string(query_params)
41
35
  action = { method: 'get', url: endpoint }
42
36
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -44,9 +38,7 @@ module Adyen
44
38
 
45
39
  # Get a list of Payments Apps - store level
46
40
  def list_payments_app_for_store(merchant_id, store_id, headers: {}, query_params: {})
47
- endpoint = '/merchants/{merchantId}/stores/{storeId}/paymentsApps'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, merchant_id, store_id)
41
+ endpoint = build_endpoint('/merchants/{merchantId}/stores/{storeId}/paymentsApps', merchant_id, store_id)
50
42
  endpoint += create_query_string(query_params)
51
43
  action = { method: 'get', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -54,9 +46,7 @@ module Adyen
54
46
 
55
47
  # Revoke Payments App instance authentication
56
48
  def revoke_payments_app(merchant_id, installation_id, headers: {})
57
- endpoint = '/merchants/{merchantId}/paymentsApps/{installationId}/revoke'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint, merchant_id, installation_id)
49
+ endpoint = build_endpoint('/merchants/{merchantId}/paymentsApps/{installationId}/revoke', merchant_id, installation_id)
60
50
 
61
51
  action = { method: 'post', url: endpoint }
62
52
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Store payout details
16
16
  def store_detail(request, headers: {})
17
- endpoint = '/storeDetail'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/storeDetail')
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Store details and submit a payout
26
24
  def store_detail_and_submit_third_party(request, headers: {})
27
- endpoint = '/storeDetailAndSubmitThirdParty'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/storeDetailAndSubmitThirdParty')
30
26
 
31
27
  action = { method: 'post', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Submit a payout
36
32
  def submit_third_party(request, headers: {})
37
- endpoint = '/submitThirdParty'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/submitThirdParty')
40
34
 
41
35
  action = { method: 'post', url: endpoint }
42
36
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Make an instant card payout
16
16
  def payout(request, headers: {})
17
- endpoint = '/payout'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/payout')
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Confirm a payout
16
16
  def confirm_third_party(request, headers: {})
17
- endpoint = '/confirmThirdParty'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/confirmThirdParty')
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Cancel a payout
26
24
  def decline_third_party(request, headers: {})
27
- endpoint = '/declineThirdParty'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/declineThirdParty')
30
26
 
31
27
  action = { method: 'post', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Create a communication session
16
16
  def create_communication_session(request, headers: {})
17
- endpoint = '/sessions'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/sessions')
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -5,7 +5,7 @@ module Adyen
5
5
  # Ref: https://openapi-generator.tech
6
6
  #
7
7
  # Do not edit the class manually.
8
- class RecurringApi < Service
8
+ class LegacyRecurringApi < Service
9
9
  attr_accessor :service, :version
10
10
 
11
11
  def initialize(client, version = DEFAULT_VERSION)
@@ -16,9 +16,7 @@ module Adyen
16
16
  #
17
17
  # Deprecated since Adyen Recurring API v68
18
18
  def create_permit(request, headers: {})
19
- endpoint = '/createPermit'.gsub(/{.+?}/, '%s')
20
- endpoint = endpoint.gsub(%r{^/}, '')
21
- endpoint = format(endpoint)
19
+ endpoint = build_endpoint('/createPermit')
22
20
 
23
21
  action = { method: 'post', url: endpoint }
24
22
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -26,9 +24,7 @@ module Adyen
26
24
 
27
25
  # Disable stored payment details
28
26
  def disable(request, headers: {})
29
- endpoint = '/disable'.gsub(/{.+?}/, '%s')
30
- endpoint = endpoint.gsub(%r{^/}, '')
31
- endpoint = format(endpoint)
27
+ endpoint = build_endpoint('/disable')
32
28
 
33
29
  action = { method: 'post', url: endpoint }
34
30
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -38,9 +34,7 @@ module Adyen
38
34
  #
39
35
  # Deprecated since Adyen Recurring API v68
40
36
  def disable_permit(request, headers: {})
41
- endpoint = '/disablePermit'.gsub(/{.+?}/, '%s')
42
- endpoint = endpoint.gsub(%r{^/}, '')
43
- endpoint = format(endpoint)
37
+ endpoint = build_endpoint('/disablePermit')
44
38
 
45
39
  action = { method: 'post', url: endpoint }
46
40
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -48,9 +42,7 @@ module Adyen
48
42
 
49
43
  # Get stored payment details
50
44
  def list_recurring_details(request, headers: {})
51
- endpoint = '/listRecurringDetails'.gsub(/{.+?}/, '%s')
52
- endpoint = endpoint.gsub(%r{^/}, '')
53
- endpoint = format(endpoint)
45
+ endpoint = build_endpoint('/listRecurringDetails')
54
46
 
55
47
  action = { method: 'post', url: endpoint }
56
48
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -58,9 +50,7 @@ module Adyen
58
50
 
59
51
  # Ask issuer to notify the shopper
60
52
  def notify_shopper(request, headers: {})
61
- endpoint = '/notifyShopper'.gsub(/{.+?}/, '%s')
62
- endpoint = endpoint.gsub(%r{^/}, '')
63
- endpoint = format(endpoint)
53
+ endpoint = build_endpoint('/notifyShopper')
64
54
 
65
55
  action = { method: 'post', url: endpoint }
66
56
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -68,9 +58,7 @@ module Adyen
68
58
 
69
59
  # Schedule running the Account Updater
70
60
  def schedule_account_updater(request, headers: {})
71
- endpoint = '/scheduleAccountUpdater'.gsub(/{.+?}/, '%s')
72
- endpoint = endpoint.gsub(%r{^/}, '')
73
- endpoint = format(endpoint)
61
+ endpoint = build_endpoint('/scheduleAccountUpdater')
74
62
 
75
63
  action = { method: 'post', url: endpoint }
76
64
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -17,7 +17,7 @@ module Adyen
17
17
  end
18
18
 
19
19
  def recurring_api
20
- @recurring_api ||= Adyen::RecurringApi.new(@client, @version)
20
+ @recurring_api ||= Adyen::LegacyRecurringApi.new(@client, @version)
21
21
  end
22
22
 
23
23
  end
@@ -27,8 +27,16 @@ module Adyen
27
27
  end
28
28
 
29
29
  # create query parameter from a hash
30
- def create_query_string(arr)
31
- "?#{URI.encode_www_form(arr)}"
30
+ def create_query_string(params)
31
+ return '' if params.empty?
32
+ "?#{URI.encode_www_form(params)}"
33
+ end
34
+
35
+ private
36
+
37
+ def build_endpoint(path, *params)
38
+ endpoint = path.gsub('%', '%%').gsub(/{.+?}/, '%s').delete_prefix('/')
39
+ format(endpoint, *params)
32
40
  end
33
41
  end
34
42
  end
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Create a session token
16
16
  def create_authentication_session(request, headers: {})
17
- endpoint = '/sessions'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/sessions')
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Changes the status of the payment method.
16
16
  def change_status(request, headers: {})
17
- endpoint = '/changeStatus'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/changeStatus')
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Checks the balance.
26
24
  def check_balance(request, headers: {})
27
- endpoint = '/checkBalance'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/checkBalance')
30
26
 
31
27
  action = { method: 'post', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Issues a new card.
36
32
  def issue(request, headers: {})
37
- endpoint = '/issue'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/issue')
40
34
 
41
35
  action = { method: 'post', url: endpoint }
42
36
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -44,9 +38,7 @@ module Adyen
44
38
 
45
39
  # Loads the payment method.
46
40
  def load(request, headers: {})
47
- endpoint = '/load'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint)
41
+ endpoint = build_endpoint('/load')
50
42
 
51
43
  action = { method: 'post', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -54,9 +46,7 @@ module Adyen
54
46
 
55
47
  # Merge the balance of two cards.
56
48
  def merge_balance(request, headers: {})
57
- endpoint = '/mergeBalance'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint)
49
+ endpoint = build_endpoint('/mergeBalance')
60
50
 
61
51
  action = { method: 'post', url: endpoint }
62
52
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -64,9 +54,7 @@ module Adyen
64
54
 
65
55
  # Voids a transaction.
66
56
  def void_transaction(request, headers: {})
67
- endpoint = '/voidTransaction'.gsub(/{.+?}/, '%s')
68
- endpoint = endpoint.gsub(%r{^/}, '')
69
- endpoint = format(endpoint)
57
+ endpoint = build_endpoint('/voidTransaction')
70
58
 
71
59
  action = { method: 'post', url: endpoint }
72
60
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -17,9 +17,7 @@ module Adyen
17
17
  # Deprecated since Transfers API v4
18
18
  # Use the `/grants` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grants) instead.
19
19
  def get_capital_account(headers: {}, query_params: {})
20
- endpoint = '/grants'.gsub(/{.+?}/, '%s')
21
- endpoint = endpoint.gsub(%r{^/}, '')
22
- endpoint = format(endpoint)
20
+ endpoint = build_endpoint('/grants')
23
21
  endpoint += create_query_string(query_params)
24
22
  action = { method: 'get', url: endpoint }
25
23
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -30,9 +28,7 @@ module Adyen
30
28
  # Deprecated since Transfers API v4
31
29
  # Use the `/grants/{grantId}` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/get/grants/(grantId)) instead.
32
30
  def get_grant_reference_details(id, headers: {})
33
- endpoint = '/grants/{id}'.gsub(/{.+?}/, '%s')
34
- endpoint = endpoint.gsub(%r{^/}, '')
35
- endpoint = format(endpoint, id)
31
+ endpoint = build_endpoint('/grants/{id}', id)
36
32
 
37
33
  action = { method: 'get', url: endpoint }
38
34
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -43,9 +39,7 @@ module Adyen
43
39
  # Deprecated since Transfers API v4
44
40
  # Use the `/grants` endpoint from the [Capital API](https://docs.adyen.com/api-explorer/capital/latest/post/grants) instead.
45
41
  def request_grant_payout(request, headers: {})
46
- endpoint = '/grants'.gsub(/{.+?}/, '%s')
47
- endpoint = endpoint.gsub(%r{^/}, '')
48
- endpoint = format(endpoint)
42
+ endpoint = build_endpoint('/grants')
49
43
 
50
44
  action = { method: 'post', url: endpoint }
51
45
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Get all transactions
16
16
  def get_all_transactions(headers: {}, query_params: {})
17
- endpoint = '/transactions'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/transactions')
20
18
  endpoint += create_query_string(query_params)
21
19
  action = { method: 'get', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Get a transaction
26
24
  def get_transaction(id, headers: {})
27
- endpoint = '/transactions/{id}'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, id)
25
+ endpoint = build_endpoint('/transactions/{id}', id)
30
26
 
31
27
  action = { method: 'get', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Approve initiated transfers
16
16
  def approve_initiated_transfers(request, headers: {})
17
- endpoint = '/transfers/approve'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/transfers/approve')
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -24,9 +22,7 @@ module Adyen
24
22
 
25
23
  # Cancel initiated transfers
26
24
  def cancel_initiated_transfers(request, headers: {})
27
- endpoint = '/transfers/cancel'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/transfers/cancel')
30
26
 
31
27
  action = { method: 'post', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get all transfers
36
32
  def get_all_transfers(headers: {}, query_params: {})
37
- endpoint = '/transfers'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint)
33
+ endpoint = build_endpoint('/transfers')
40
34
  endpoint += create_query_string(query_params)
41
35
  action = { method: 'get', url: endpoint }
42
36
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -44,9 +38,7 @@ module Adyen
44
38
 
45
39
  # Get a transfer
46
40
  def get_transfer(id, headers: {})
47
- endpoint = '/transfers/{id}'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, id)
41
+ endpoint = build_endpoint('/transfers/{id}', id)
50
42
 
51
43
  action = { method: 'get', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -54,9 +46,7 @@ module Adyen
54
46
 
55
47
  # Return a transfer
56
48
  def return_transfer(request, transfer_id, headers: {})
57
- endpoint = '/transfers/{transferId}/returns'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint, transfer_id)
49
+ endpoint = build_endpoint('/transfers/{transferId}/returns', transfer_id)
60
50
 
61
51
  action = { method: 'post', url: endpoint }
62
52
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -64,9 +54,7 @@ module Adyen
64
54
 
65
55
  # Transfer funds
66
56
  def transfer_funds(request, headers: {})
67
- endpoint = '/transfers'.gsub(/{.+?}/, '%s')
68
- endpoint = endpoint.gsub(%r{^/}, '')
69
- endpoint = format(endpoint)
57
+ endpoint = build_endpoint('/transfers')
70
58
 
71
59
  action = { method: 'post', url: endpoint }
72
60
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -38,7 +38,6 @@ module Adyen
38
38
  # @return [Boolean] Returns true if the HMAC signature is valid, otherwise false.
39
39
  def valid_webhook_payload_hmac?(hmac_signature, hmac_key, payload)
40
40
  expected_sign = calculate_webhook_payload_hmac(payload, hmac_key)
41
- puts(expected_sign)
42
41
  expected_sign == hmac_signature
43
42
  end
44
43
 
data/lib/adyen/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Adyen
2
2
  NAME = 'adyen-ruby-api-library'.freeze
3
- VERSION = '11.1.0'.freeze
3
+ VERSION = '11.3.0'.freeze
4
4
  end
@@ -23,4 +23,5 @@ require_relative 'adyen/services/posMobile'
23
23
  require_relative 'adyen/services/openBanking'
24
24
  require_relative 'adyen/services/sessionAuthentication'
25
25
  require_relative 'adyen/services/balanceControl'
26
+ require_relative 'adyen/services/capital'
26
27
 
@@ -0,0 +1,8 @@
1
+ {
2
+ "service": "balancecontrol",
3
+ "project": "ruby",
4
+ "generatedAt": "2026-04-20T13:39:52Z",
5
+ "openapiCommitSha": "3550ecd3f320efaad6bee55ffed5122cb9ba09d5",
6
+ "automationCommitSha": "4ad0c0c7e87bc0e5994a9a3350a991d0691350bb",
7
+ "libraryCommitSha": "60ccdbdbbb7069d54600a8a8cd19eea245661134"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "service": "balanceplatform",
3
+ "project": "ruby",
4
+ "generatedAt": "2026-04-20T13:40:00Z",
5
+ "openapiCommitSha": "3550ecd3f320efaad6bee55ffed5122cb9ba09d5",
6
+ "automationCommitSha": "4ad0c0c7e87bc0e5994a9a3350a991d0691350bb",
7
+ "libraryCommitSha": "60ccdbdbbb7069d54600a8a8cd19eea245661134"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "service": "binlookup",
3
+ "project": "ruby",
4
+ "generatedAt": "2026-04-20T13:39:47Z",
5
+ "openapiCommitSha": "3550ecd3f320efaad6bee55ffed5122cb9ba09d5",
6
+ "automationCommitSha": "4ad0c0c7e87bc0e5994a9a3350a991d0691350bb",
7
+ "libraryCommitSha": "60ccdbdbbb7069d54600a8a8cd19eea245661134"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "service": "capital",
3
+ "project": "ruby",
4
+ "generatedAt": "2026-04-20T13:39:47Z",
5
+ "openapiCommitSha": "3550ecd3f320efaad6bee55ffed5122cb9ba09d5",
6
+ "automationCommitSha": "4ad0c0c7e87bc0e5994a9a3350a991d0691350bb",
7
+ "libraryCommitSha": "60ccdbdbbb7069d54600a8a8cd19eea245661134"
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "service": "checkout",
3
+ "project": "ruby",
4
+ "generatedAt": "2026-04-20T13:39:49Z",
5
+ "openapiCommitSha": "3550ecd3f320efaad6bee55ffed5122cb9ba09d5",
6
+ "automationCommitSha": "4ad0c0c7e87bc0e5994a9a3350a991d0691350bb",
7
+ "libraryCommitSha": "60ccdbdbbb7069d54600a8a8cd19eea245661134"
8
+ }