adyen-ruby-api-library 11.2.0 → 12.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 (214) 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/release.yml +1 -1
  5. data/.github/workflows/ruby.yml +3 -3
  6. data/.github/workflows/rubygems_release.yml +1 -1
  7. data/.github/workflows/stale.yml +1 -1
  8. data/Gemfile +2 -2
  9. data/README.md +30 -7
  10. data/VERSION +1 -1
  11. data/adyen-ruby-api-library.gemspec +1 -1
  12. data/lib/adyen/client.rb +10 -16
  13. data/lib/adyen/deprecation.rb +34 -0
  14. data/lib/adyen/services/balanceControl/balance_control_api.rb +3 -3
  15. data/lib/adyen/services/balancePlatform/account_holders_api.rb +14 -18
  16. data/lib/adyen/services/balancePlatform/authorized_card_users_api.rb +4 -12
  17. data/lib/adyen/services/balancePlatform/balance_accounts_api.rb +5 -65
  18. data/lib/adyen/services/balancePlatform/balances_api.rb +5 -15
  19. data/lib/adyen/services/balancePlatform/bank_account_validation_api.rb +1 -3
  20. data/lib/adyen/services/balancePlatform/card_orders_api.rb +2 -6
  21. data/lib/adyen/services/balancePlatform/custom_payout_schedules_sweeps_api.rb +56 -0
  22. data/lib/adyen/services/balancePlatform/direct_debit_mandates_api.rb +48 -0
  23. data/lib/adyen/services/balancePlatform/grant_accounts_api.rb +3 -3
  24. data/lib/adyen/services/balancePlatform/grant_offers_api.rb +6 -6
  25. data/lib/adyen/services/balancePlatform/manage_card_pin_api.rb +3 -9
  26. data/lib/adyen/services/balancePlatform/manage_sca_devices_api.rb +6 -18
  27. data/lib/adyen/services/balancePlatform/managed_payout_schedules_api.rb +80 -0
  28. data/lib/adyen/services/balancePlatform/network_tokens_api.rb +2 -6
  29. data/lib/adyen/services/balancePlatform/payment_instrument_groups_api.rb +3 -9
  30. data/lib/adyen/services/balancePlatform/payment_instruments_api.rb +9 -27
  31. data/lib/adyen/services/balancePlatform/platform_api.rb +3 -9
  32. data/lib/adyen/services/balancePlatform/recurring_top_ups_api.rb +48 -0
  33. data/lib/adyen/services/balancePlatform/sca_association_management_api.rb +3 -9
  34. data/lib/adyen/services/balancePlatform/sca_device_management_api.rb +11 -9
  35. data/lib/adyen/services/balancePlatform/transaction_rules_api.rb +4 -12
  36. data/lib/adyen/services/balancePlatform/transfer_limits_balance_account_level_api.rb +6 -18
  37. data/lib/adyen/services/balancePlatform/transfer_limits_balance_platform_level_api.rb +4 -12
  38. data/lib/adyen/services/balancePlatform/transfer_routes_api.rb +1 -3
  39. data/lib/adyen/services/balancePlatform.rb +20 -0
  40. data/lib/adyen/services/binLookup/bin_lookup_api.rb +2 -6
  41. data/lib/adyen/services/capital/dynamic_offers_api.rb +40 -0
  42. data/lib/adyen/services/capital/grant_accounts_api.rb +1 -3
  43. data/lib/adyen/services/capital/grant_offers_api.rb +4 -8
  44. data/lib/adyen/services/capital/grants_api.rb +6 -18
  45. data/lib/adyen/services/capital.rb +5 -0
  46. data/lib/adyen/services/checkout/donations_api.rb +2 -6
  47. data/lib/adyen/services/checkout/modifications_api.rb +6 -18
  48. data/lib/adyen/services/checkout/orders_api.rb +3 -9
  49. data/lib/adyen/services/checkout/payment_links_api.rb +3 -9
  50. data/lib/adyen/services/checkout/payments_api.rb +14 -18
  51. data/lib/adyen/services/checkout/recurring_api.rb +4 -12
  52. data/lib/adyen/services/checkout/utility_api.rb +6 -12
  53. data/lib/adyen/services/checkout.rb +1 -1
  54. data/lib/adyen/services/dataProtection/data_protection_api.rb +1 -3
  55. data/lib/adyen/services/disputes/disputes_api.rb +5 -15
  56. data/lib/adyen/services/legalEntityManagement/business_lines_api.rb +4 -12
  57. data/lib/adyen/services/legalEntityManagement/documents_api.rb +4 -12
  58. data/lib/adyen/services/legalEntityManagement/hosted_onboarding_api.rb +3 -9
  59. data/lib/adyen/services/legalEntityManagement/legal_entities_api.rb +7 -21
  60. data/lib/adyen/services/legalEntityManagement/pci_questionnaires_api.rb +5 -15
  61. data/lib/adyen/services/legalEntityManagement/tax_e_delivery_consent_api.rb +2 -6
  62. data/lib/adyen/services/legalEntityManagement/terms_of_service_api.rb +5 -15
  63. data/lib/adyen/services/legalEntityManagement/transfer_instruments_api.rb +4 -12
  64. data/lib/adyen/services/management/account_company_level_api.rb +3 -9
  65. data/lib/adyen/services/management/account_merchant_level_api.rb +4 -12
  66. data/lib/adyen/services/management/account_store_level_api.rb +8 -24
  67. data/lib/adyen/services/management/allowed_origins_company_level_api.rb +4 -12
  68. data/lib/adyen/services/management/allowed_origins_merchant_level_api.rb +4 -12
  69. data/lib/adyen/services/management/android_files_company_level_api.rb +6 -18
  70. data/lib/adyen/services/management/api_credentials_company_level_api.rb +4 -12
  71. data/lib/adyen/services/management/api_credentials_merchant_level_api.rb +4 -12
  72. data/lib/adyen/services/management/api_key_company_level_api.rb +1 -3
  73. data/lib/adyen/services/management/api_key_merchant_level_api.rb +1 -3
  74. data/lib/adyen/services/management/client_key_company_level_api.rb +1 -3
  75. data/lib/adyen/services/management/client_key_merchant_level_api.rb +1 -3
  76. data/lib/adyen/services/management/donation_campaigns_api.rb +64 -0
  77. data/lib/adyen/services/management/my_api_credential_api.rb +6 -18
  78. data/lib/adyen/services/management/payment_methods_merchant_level_api.rb +6 -18
  79. data/lib/adyen/services/management/payout_settings_merchant_level_api.rb +5 -15
  80. data/lib/adyen/services/management/split_configuration_merchant_level_api.rb +9 -27
  81. data/lib/adyen/services/management/terminal_actions_company_level_api.rb +2 -6
  82. data/lib/adyen/services/management/terminal_actions_terminal_level_api.rb +1 -3
  83. data/lib/adyen/services/management/terminal_orders_company_level_api.rb +10 -30
  84. data/lib/adyen/services/management/terminal_orders_merchant_level_api.rb +10 -30
  85. data/lib/adyen/services/management/terminal_settings_company_level_api.rb +4 -12
  86. data/lib/adyen/services/management/terminal_settings_merchant_level_api.rb +4 -12
  87. data/lib/adyen/services/management/terminal_settings_store_level_api.rb +8 -24
  88. data/lib/adyen/services/management/terminal_settings_terminal_level_api.rb +4 -12
  89. data/lib/adyen/services/management/terminals_terminal_level_api.rb +2 -6
  90. data/lib/adyen/services/management/users_company_level_api.rb +4 -12
  91. data/lib/adyen/services/management/users_merchant_level_api.rb +4 -12
  92. data/lib/adyen/services/management/webhooks_company_level_api.rb +7 -21
  93. data/lib/adyen/services/management/webhooks_merchant_level_api.rb +7 -21
  94. data/lib/adyen/services/management.rb +5 -0
  95. data/lib/adyen/services/payment/modifications_api.rb +10 -24
  96. data/lib/adyen/services/payment/payments_api.rb +5 -15
  97. data/lib/adyen/services/paymentsApp/payments_app_api.rb +5 -15
  98. data/lib/adyen/services/payout/initialization_api.rb +3 -9
  99. data/lib/adyen/services/payout/instant_payouts_api.rb +1 -3
  100. data/lib/adyen/services/payout/reviewing_api.rb +2 -6
  101. data/lib/adyen/services/posMobile/pos_mobile_api.rb +6 -3
  102. data/lib/adyen/services/posTerminalManagement.rb +10 -0
  103. data/lib/adyen/services/recurring/recurring_api.rb +10 -18
  104. data/lib/adyen/services/service.rb +12 -2
  105. data/lib/adyen/services/sessionAuthentication/session_authentication_api.rb +1 -3
  106. data/lib/adyen/services/storedValue/stored_value_api.rb +6 -18
  107. data/lib/adyen/services/transfers/capital_api.rb +9 -9
  108. data/lib/adyen/services/transfers/cash_out_api.rb +24 -0
  109. data/lib/adyen/services/transfers/transactions_api.rb +2 -6
  110. data/lib/adyen/services/transfers/transfers_api.rb +6 -18
  111. data/lib/adyen/services/transfers.rb +5 -0
  112. data/lib/adyen/utils/hmac_validator.rb +15 -18
  113. data/lib/adyen/version.rb +1 -1
  114. data/sdk-generation-log/balancecontrol.json +8 -0
  115. data/sdk-generation-log/balanceplatform.json +8 -0
  116. data/sdk-generation-log/binlookup.json +8 -0
  117. data/sdk-generation-log/capital.json +8 -0
  118. data/sdk-generation-log/checkout.json +8 -0
  119. data/sdk-generation-log/dataprotection.json +8 -0
  120. data/sdk-generation-log/disputes.json +8 -0
  121. data/sdk-generation-log/legalentitymanagement.json +8 -0
  122. data/sdk-generation-log/management.json +8 -0
  123. data/sdk-generation-log/payment.json +8 -0
  124. data/sdk-generation-log/paymentsapp.json +8 -0
  125. data/sdk-generation-log/payout.json +8 -0
  126. data/sdk-generation-log/posmobile.json +8 -0
  127. data/sdk-generation-log/recurring.json +8 -0
  128. data/sdk-generation-log/sessionauthentication.json +8 -0
  129. data/sdk-generation-log/storedvalue.json +8 -0
  130. data/sdk-generation-log/transfers.json +8 -0
  131. data/spec/balance_control_spec.rb +41 -0
  132. data/spec/balance_platform_spec.rb +609 -4
  133. data/spec/capital_spec.rb +82 -0
  134. data/spec/checkout-oauth_spec.rb +220 -10
  135. data/spec/checkout_spec.rb +245 -10
  136. data/spec/client_spec.rb +23 -5
  137. data/spec/deprecation_spec.rb +112 -0
  138. data/spec/management_spec.rb +184 -0
  139. data/spec/mocks/requests/BalancePlatform/apply_managed_schedule.json +14 -0
  140. data/spec/mocks/requests/BalancePlatform/begin_sca_device_registration.json +4 -0
  141. data/spec/mocks/requests/BalancePlatform/create_recurring_top_up.json +21 -0
  142. data/spec/mocks/requests/BalancePlatform/create_sweep.json +10 -0
  143. data/spec/mocks/requests/BalancePlatform/finish_sca_device_registration.json +3 -0
  144. data/spec/mocks/requests/BalancePlatform/submit_sca_association.json +8 -0
  145. data/spec/mocks/requests/BalancePlatform/update_balance_account_managed_schedule.json +5 -0
  146. data/spec/mocks/requests/BalancePlatform/update_mandate.json +14 -0
  147. data/spec/mocks/requests/BalancePlatform/update_recurring_top_ups.json +3 -0
  148. data/spec/mocks/requests/BalancePlatform/update_sweep.json +6 -0
  149. data/spec/mocks/requests/Checkout/amount_updates.json +1 -1
  150. data/spec/mocks/requests/Checkout/card_details.json +3 -0
  151. data/spec/mocks/requests/Checkout/create_stored_payment_method.json +10 -0
  152. data/spec/mocks/requests/Checkout/donation_campaigns.json +4 -0
  153. data/spec/mocks/requests/Checkout/donations.json +9 -0
  154. data/spec/mocks/requests/Checkout/orders.json +5 -3
  155. data/spec/mocks/requests/Checkout/payment-details.json +2 -14
  156. data/spec/mocks/requests/Checkout/payment_methods_balance.json +5 -2
  157. data/spec/mocks/requests/Checkout/payments.json +9 -10
  158. data/spec/mocks/requests/Checkout/paypal_update_order.json +5 -0
  159. data/spec/mocks/requests/Checkout/reversals.json +3 -0
  160. data/spec/mocks/requests/Checkout/update_session.json +7 -0
  161. data/spec/mocks/requests/Management/create_donation_campaign.json +7 -0
  162. data/spec/mocks/requests/Management/list_nonprofits.json +5 -0
  163. data/spec/mocks/requests/Management/update_donation_campaign.json +6 -0
  164. data/spec/mocks/requests/Transfers/initiate_cashout.json +12 -0
  165. data/spec/mocks/responses/BalancePlatform/apply_managed_schedule.json +17 -0
  166. data/spec/mocks/responses/BalancePlatform/begin_sca_device_registration.json +8 -0
  167. data/spec/mocks/responses/BalancePlatform/create_recurring_top_up.json +23 -0
  168. data/spec/mocks/responses/BalancePlatform/create_sweep.json +12 -0
  169. data/spec/mocks/responses/BalancePlatform/finish_sca_device_registration.json +7 -0
  170. data/spec/mocks/responses/BalancePlatform/get_all_sweeps_for_balance_account.json +31 -0
  171. data/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedule_by_id.json +17 -0
  172. data/spec/mocks/responses/BalancePlatform/get_balance_account_managed_schedules.json +26 -0
  173. data/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedule_by_id.json +27 -0
  174. data/spec/mocks/responses/BalancePlatform/get_balance_platform_managed_schedules.json +31 -0
  175. data/spec/mocks/responses/BalancePlatform/get_list_of_mandates.json +19 -0
  176. data/spec/mocks/responses/BalancePlatform/get_mandate_by_id.json +14 -0
  177. data/spec/mocks/responses/BalancePlatform/get_payout_schedule_executions.json +21 -0
  178. data/spec/mocks/responses/BalancePlatform/get_recurring_top_ups.json +35 -0
  179. data/spec/mocks/responses/BalancePlatform/get_sweep.json +12 -0
  180. data/spec/mocks/responses/BalancePlatform/get_tax_form_summary.json +17 -0
  181. data/spec/mocks/responses/BalancePlatform/submit_sca_association.json +10 -0
  182. data/spec/mocks/responses/BalancePlatform/update_balance_account_managed_schedule.json +18 -0
  183. data/spec/mocks/responses/BalancePlatform/update_recurring_top_ups.json +23 -0
  184. data/spec/mocks/responses/BalancePlatform/update_sweep.json +12 -0
  185. data/spec/mocks/responses/Capital/calculate-preliminary-offer-from-dynamic-offer.json +16 -0
  186. data/spec/mocks/responses/Capital/create-static-offer-from-dynamic-offer.json +9 -0
  187. data/spec/mocks/responses/Capital/get-all-dynamic-offers.json +18 -0
  188. data/spec/mocks/responses/Checkout/amount_updates.json +1 -1
  189. data/spec/mocks/responses/Checkout/card_details.json +5 -0
  190. data/spec/mocks/responses/Checkout/create_stored_payment_method.json +5 -0
  191. data/spec/mocks/responses/Checkout/donation_campaigns.json +1 -0
  192. data/spec/mocks/responses/Checkout/donations.json +5 -0
  193. data/spec/mocks/responses/Checkout/orders.json +6 -1
  194. data/spec/mocks/responses/Checkout/orders_cancel.json +1 -1
  195. data/spec/mocks/responses/Checkout/payment-details.json +2 -13
  196. data/spec/mocks/responses/Checkout/payment_links.json +3 -0
  197. data/spec/mocks/responses/Checkout/payment_methods.json +2 -2
  198. data/spec/mocks/responses/Checkout/payment_methods_balance.json +5 -1
  199. data/spec/mocks/responses/Checkout/payments.json +4 -94
  200. data/spec/mocks/responses/Checkout/paypal_update_order.json +4 -0
  201. data/spec/mocks/responses/Checkout/reversals.json +6 -0
  202. data/spec/mocks/responses/Checkout/update_session.json +3 -0
  203. data/spec/mocks/responses/Management/donation_campaign.json +13 -0
  204. data/spec/mocks/responses/Management/list_donation_campaigns.json +19 -0
  205. data/spec/mocks/responses/Management/list_nonprofits.json +34 -0
  206. data/spec/mocks/responses/Transfers/initiate_cashout.json +31 -0
  207. data/spec/service_spec.rb +40 -0
  208. data/spec/spec_helper.rb +2 -2
  209. data/spec/transfers_spec.rb +28 -0
  210. data/spec/utils/consumer_smoke.rb +23 -0
  211. data/spec/utils/hmac_validator_spec.rb +55 -0
  212. data/templates/api-small.mustache +4 -4
  213. data/templates/api.mustache +4 -4
  214. metadata +84 -2
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Create a store
16
16
  def create_store(request, headers: {})
17
- endpoint = '/stores'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/stores')
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 store
26
24
  def create_store_by_merchant_id(request, merchant_id, headers: {})
27
- endpoint = '/merchants/{merchantId}/stores'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, merchant_id)
25
+ endpoint = build_endpoint('/merchants/{merchantId}/stores', merchant_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 store
36
32
  def get_store(merchant_id, store_id, headers: {})
37
- endpoint = '/merchants/{merchantId}/stores/{storeId}'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, merchant_id, store_id)
33
+ endpoint = build_endpoint('/merchants/{merchantId}/stores/{storeId}', merchant_id, store_id)
40
34
 
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 store
46
40
  def get_store_by_id(store_id, headers: {})
47
- endpoint = '/stores/{storeId}'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, store_id)
41
+ endpoint = build_endpoint('/stores/{storeId}', store_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
  # Get a list of stores
56
48
  def list_stores(headers: {}, query_params: {})
57
- endpoint = '/stores'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint)
49
+ endpoint = build_endpoint('/stores')
60
50
  endpoint += create_query_string(query_params)
61
51
  action = { method: 'get', url: endpoint }
62
52
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -64,9 +54,7 @@ module Adyen
64
54
 
65
55
  # Get a list of stores
66
56
  def list_stores_by_merchant_id(merchant_id, headers: {}, query_params: {})
67
- endpoint = '/merchants/{merchantId}/stores'.gsub(/{.+?}/, '%s')
68
- endpoint = endpoint.gsub(%r{^/}, '')
69
- endpoint = format(endpoint, merchant_id)
57
+ endpoint = build_endpoint('/merchants/{merchantId}/stores', merchant_id)
70
58
  endpoint += create_query_string(query_params)
71
59
  action = { method: 'get', url: endpoint }
72
60
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -74,9 +62,7 @@ module Adyen
74
62
 
75
63
  # Update a store
76
64
  def update_store(request, merchant_id, store_id, headers: {})
77
- endpoint = '/merchants/{merchantId}/stores/{storeId}'.gsub(/{.+?}/, '%s')
78
- endpoint = endpoint.gsub(%r{^/}, '')
79
- endpoint = format(endpoint, merchant_id, store_id)
65
+ endpoint = build_endpoint('/merchants/{merchantId}/stores/{storeId}', merchant_id, store_id)
80
66
 
81
67
  action = { method: 'patch', url: endpoint }
82
68
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -84,9 +70,7 @@ module Adyen
84
70
 
85
71
  # Update a store
86
72
  def update_store_by_id(request, store_id, headers: {})
87
- endpoint = '/stores/{storeId}'.gsub(/{.+?}/, '%s')
88
- endpoint = endpoint.gsub(%r{^/}, '')
89
- endpoint = format(endpoint, store_id)
73
+ endpoint = build_endpoint('/stores/{storeId}', store_id)
90
74
 
91
75
  action = { method: 'patch', url: endpoint }
92
76
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Create an allowed origin
16
16
  def create_allowed_origin(request, company_id, api_credential_id, headers: {})
17
- endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, company_id, api_credential_id)
17
+ endpoint = build_endpoint('/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins', company_id, api_credential_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
  # Delete an allowed origin
26
24
  def delete_allowed_origin(company_id, api_credential_id, origin_id, headers: {})
27
- endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, company_id, api_credential_id, origin_id)
25
+ endpoint = build_endpoint('/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}', company_id, api_credential_id, origin_id)
30
26
 
31
27
  action = { method: 'delete', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get an allowed origin
36
32
  def get_allowed_origin(company_id, api_credential_id, origin_id, headers: {})
37
- endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, company_id, api_credential_id, origin_id)
33
+ endpoint = build_endpoint('/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}', company_id, api_credential_id, origin_id)
40
34
 
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 allowed origins
46
40
  def list_allowed_origins(company_id, api_credential_id, headers: {})
47
- endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, company_id, api_credential_id)
41
+ endpoint = build_endpoint('/companies/{companyId}/apiCredentials/{apiCredentialId}/allowedOrigins', company_id, api_credential_id)
50
42
 
51
43
  action = { method: 'get', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Create an allowed origin
16
16
  def create_allowed_origin(request, merchant_id, api_credential_id, headers: {})
17
- endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, merchant_id, api_credential_id)
17
+ endpoint = build_endpoint('/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins', merchant_id, api_credential_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
  # Delete an allowed origin
26
24
  def delete_allowed_origin(merchant_id, api_credential_id, origin_id, headers: {})
27
- endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, merchant_id, api_credential_id, origin_id)
25
+ endpoint = build_endpoint('/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}', merchant_id, api_credential_id, origin_id)
30
26
 
31
27
  action = { method: 'delete', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get an allowed origin
36
32
  def get_allowed_origin(merchant_id, api_credential_id, origin_id, headers: {})
37
- endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, merchant_id, api_credential_id, origin_id)
33
+ endpoint = build_endpoint('/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}', merchant_id, api_credential_id, origin_id)
40
34
 
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 allowed origins
46
40
  def list_allowed_origins(merchant_id, api_credential_id, headers: {})
47
- endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, merchant_id, api_credential_id)
41
+ endpoint = build_endpoint('/merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins', merchant_id, api_credential_id)
50
42
 
51
43
  action = { method: 'get', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Get Android app
16
16
  def get_android_app(company_id, id, headers: {})
17
- endpoint = '/companies/{companyId}/androidApps/{id}'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, company_id, id)
17
+ endpoint = build_endpoint('/companies/{companyId}/androidApps/{id}', company_id, id)
20
18
 
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 list of Android apps
26
24
  def list_android_apps(company_id, headers: {}, query_params: {})
27
- endpoint = '/companies/{companyId}/androidApps'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, company_id)
25
+ endpoint = build_endpoint('/companies/{companyId}/androidApps', company_id)
30
26
  endpoint += create_query_string(query_params)
31
27
  action = { method: 'get', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get a list of Android certificates
36
32
  def list_android_certificates(company_id, headers: {}, query_params: {})
37
- endpoint = '/companies/{companyId}/androidCertificates'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, company_id)
33
+ endpoint = build_endpoint('/companies/{companyId}/androidCertificates', company_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
  # Reprocess Android App
46
40
  def reprocess_android_app(company_id, id, headers: {})
47
- endpoint = '/companies/{companyId}/androidApps/{id}'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, company_id, id)
41
+ endpoint = build_endpoint('/companies/{companyId}/androidApps/{id}', company_id, id)
50
42
 
51
43
  action = { method: 'patch', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -54,9 +46,7 @@ module Adyen
54
46
 
55
47
  # Upload Android App
56
48
  def upload_android_app(company_id, headers: {})
57
- endpoint = '/companies/{companyId}/androidApps'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint, company_id)
49
+ endpoint = build_endpoint('/companies/{companyId}/androidApps', company_id)
60
50
 
61
51
  action = { method: 'post', url: endpoint }
62
52
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -64,9 +54,7 @@ module Adyen
64
54
 
65
55
  # Upload Android Certificate
66
56
  def upload_android_certificate(company_id, headers: {})
67
- endpoint = '/companies/{companyId}/androidCertificates'.gsub(/{.+?}/, '%s')
68
- endpoint = endpoint.gsub(%r{^/}, '')
69
- endpoint = format(endpoint, company_id)
57
+ endpoint = build_endpoint('/companies/{companyId}/androidCertificates', company_id)
70
58
 
71
59
  action = { method: 'post', url: endpoint }
72
60
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Create an API credential.
16
16
  def create_api_credential(request, company_id, headers: {})
17
- endpoint = '/companies/{companyId}/apiCredentials'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, company_id)
17
+ endpoint = build_endpoint('/companies/{companyId}/apiCredentials', company_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
  # Get an API credential
26
24
  def get_api_credential(company_id, api_credential_id, headers: {})
27
- endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, company_id, api_credential_id)
25
+ endpoint = build_endpoint('/companies/{companyId}/apiCredentials/{apiCredentialId}', company_id, api_credential_id)
30
26
 
31
27
  action = { method: 'get', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get a list of API credentials
36
32
  def list_api_credentials(company_id, headers: {}, query_params: {})
37
- endpoint = '/companies/{companyId}/apiCredentials'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, company_id)
33
+ endpoint = build_endpoint('/companies/{companyId}/apiCredentials', company_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
  # Update an API credential.
46
40
  def update_api_credential(request, company_id, api_credential_id, headers: {})
47
- endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, company_id, api_credential_id)
41
+ endpoint = build_endpoint('/companies/{companyId}/apiCredentials/{apiCredentialId}', company_id, api_credential_id)
50
42
 
51
43
  action = { method: 'patch', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Create an API credential
16
16
  def create_api_credential(request, merchant_id, headers: {})
17
- endpoint = '/merchants/{merchantId}/apiCredentials'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, merchant_id)
17
+ endpoint = build_endpoint('/merchants/{merchantId}/apiCredentials', 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
  # Get an API credential
26
24
  def get_api_credential(merchant_id, api_credential_id, headers: {})
27
- endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, merchant_id, api_credential_id)
25
+ endpoint = build_endpoint('/merchants/{merchantId}/apiCredentials/{apiCredentialId}', merchant_id, api_credential_id)
30
26
 
31
27
  action = { method: 'get', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get a list of API credentials
36
32
  def list_api_credentials(merchant_id, headers: {}, query_params: {})
37
- endpoint = '/merchants/{merchantId}/apiCredentials'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, merchant_id)
33
+ endpoint = build_endpoint('/merchants/{merchantId}/apiCredentials', 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
  # Update an API credential
46
40
  def update_api_credential(request, merchant_id, api_credential_id, headers: {})
47
- endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, merchant_id, api_credential_id)
41
+ endpoint = build_endpoint('/merchants/{merchantId}/apiCredentials/{apiCredentialId}', merchant_id, api_credential_id)
50
42
 
51
43
  action = { method: 'patch', url: endpoint }
52
44
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Generate new API key
16
16
  def generate_new_api_key(company_id, api_credential_id, headers: {})
17
- endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, company_id, api_credential_id)
17
+ endpoint = build_endpoint('/companies/{companyId}/apiCredentials/{apiCredentialId}/generateApiKey', company_id, api_credential_id)
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Generate new API key
16
16
  def generate_new_api_key(merchant_id, api_credential_id, headers: {})
17
- endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, merchant_id, api_credential_id)
17
+ endpoint = build_endpoint('/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateApiKey', merchant_id, api_credential_id)
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Generate new client key
16
16
  def generate_new_client_key(company_id, api_credential_id, headers: {})
17
- endpoint = '/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, company_id, api_credential_id)
17
+ endpoint = build_endpoint('/companies/{companyId}/apiCredentials/{apiCredentialId}/generateClientKey', company_id, api_credential_id)
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Generate new client key
16
16
  def generate_new_client_key(merchant_id, api_credential_id, headers: {})
17
- endpoint = '/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, merchant_id, api_credential_id)
17
+ endpoint = build_endpoint('/merchants/{merchantId}/apiCredentials/{apiCredentialId}/generateClientKey', merchant_id, api_credential_id)
20
18
 
21
19
  action = { method: 'post', url: endpoint }
22
20
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -0,0 +1,64 @@
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 DonationCampaignsApi < Service
9
+ attr_accessor :service, :version
10
+
11
+ def initialize(client, version = DEFAULT_VERSION)
12
+ super(client, version, 'Management')
13
+ end
14
+
15
+ # Create a donation campaign
16
+ def create_donation_campaign(request, company_id, headers: {})
17
+ endpoint = build_endpoint('/companies/{companyId}/campaignManagement', company_id)
18
+
19
+ action = { method: 'post', url: endpoint }
20
+ @client.call_adyen_api(@service, action, request, headers, @version)
21
+ end
22
+
23
+ # Delete a donation campaign
24
+ def delete_donation_campaign(company_id, donation_campaign_id, headers: {})
25
+ endpoint = build_endpoint('/companies/{companyId}/campaignManagement/{donationCampaignId}', company_id, donation_campaign_id)
26
+
27
+ action = { method: 'delete', url: endpoint }
28
+ @client.call_adyen_api(@service, action, {}, headers, @version)
29
+ end
30
+
31
+ # Get the donation campaigns for an account holder
32
+ def list_donation_campaigns_for_account_holder(company_id, account_holder_id, headers: {}, query_params: {})
33
+ endpoint = build_endpoint('/companies/{companyId}/campaignManagement/accountHolders/{accountHolderId}', company_id, account_holder_id)
34
+ endpoint += create_query_string(query_params)
35
+ action = { method: 'get', url: endpoint }
36
+ @client.call_adyen_api(@service, action, {}, headers, @version)
37
+ end
38
+
39
+ # Get a list of nonprofits
40
+ def list_nonprofits(request, company_id, headers: {}, query_params: {})
41
+ endpoint = build_endpoint('/companies/{companyId}/nonprofits', company_id)
42
+ endpoint += create_query_string(query_params)
43
+ action = { method: 'post', url: endpoint }
44
+ @client.call_adyen_api(@service, action, request, headers, @version)
45
+ end
46
+
47
+ # Update a donation campaign
48
+ def update_donation_campaign(request, company_id, donation_campaign_id, headers: {})
49
+ endpoint = build_endpoint('/companies/{companyId}/campaignManagement/{donationCampaignId}', company_id, donation_campaign_id)
50
+
51
+ action = { method: 'patch', url: endpoint }
52
+ @client.call_adyen_api(@service, action, request, headers, @version)
53
+ end
54
+
55
+ # Activate or end a donation campaign
56
+ def update_donation_campaign_status(company_id, donation_campaign_id, status, headers: {})
57
+ endpoint = build_endpoint('/companies/{companyId}/campaignManagement/{donationCampaignId}/status/{status}', company_id, donation_campaign_id, status)
58
+
59
+ action = { method: 'post', url: endpoint }
60
+ @client.call_adyen_api(@service, action, {}, headers, @version)
61
+ end
62
+
63
+ end
64
+ end
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Add allowed origin
16
16
  def add_allowed_origin(request, headers: {})
17
- endpoint = '/me/allowedOrigins'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint)
17
+ endpoint = build_endpoint('/me/allowedOrigins')
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
  # Generate a client key
26
24
  def generate_client_key(headers: {})
27
- endpoint = '/me/generateClientKey'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint)
25
+ endpoint = build_endpoint('/me/generateClientKey')
30
26
 
31
27
  action = { method: 'post', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get allowed origin details
36
32
  def get_allowed_origin_details(origin_id, headers: {})
37
- endpoint = '/me/allowedOrigins/{originId}'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, origin_id)
33
+ endpoint = build_endpoint('/me/allowedOrigins/{originId}', origin_id)
40
34
 
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 allowed origins
46
40
  def get_allowed_origins(headers: {})
47
- endpoint = '/me/allowedOrigins'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint)
41
+ endpoint = build_endpoint('/me/allowedOrigins')
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
  # Get API credential details
56
48
  def get_api_credential_details(headers: {})
57
- endpoint = '/me'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint)
49
+ endpoint = build_endpoint('/me')
60
50
 
61
51
  action = { method: 'get', url: endpoint }
62
52
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -64,9 +54,7 @@ module Adyen
64
54
 
65
55
  # Remove allowed origin
66
56
  def remove_allowed_origin(origin_id, headers: {})
67
- endpoint = '/me/allowedOrigins/{originId}'.gsub(/{.+?}/, '%s')
68
- endpoint = endpoint.gsub(%r{^/}, '')
69
- endpoint = format(endpoint, origin_id)
57
+ endpoint = build_endpoint('/me/allowedOrigins/{originId}', origin_id)
70
58
 
71
59
  action = { method: 'delete', url: endpoint }
72
60
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Add an Apple Pay domain
16
16
  def add_apple_pay_domain(request, merchant_id, payment_method_id, headers: {})
17
- endpoint = '/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, merchant_id, payment_method_id)
17
+ endpoint = build_endpoint('/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/addApplePayDomains', merchant_id, payment_method_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
  # Get all payment methods
26
24
  def get_all_payment_methods(merchant_id, headers: {}, query_params: {})
27
- endpoint = '/merchants/{merchantId}/paymentMethodSettings'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, merchant_id)
25
+ endpoint = build_endpoint('/merchants/{merchantId}/paymentMethodSettings', merchant_id)
30
26
  endpoint += create_query_string(query_params)
31
27
  action = { method: 'get', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get Apple Pay domains
36
32
  def get_apple_pay_domains(merchant_id, payment_method_id, headers: {})
37
- endpoint = '/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, merchant_id, payment_method_id)
33
+ endpoint = build_endpoint('/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}/getApplePayDomains', merchant_id, payment_method_id)
40
34
 
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 payment method details
46
40
  def get_payment_method_details(merchant_id, payment_method_id, headers: {})
47
- endpoint = '/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, merchant_id, payment_method_id)
41
+ endpoint = build_endpoint('/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}', merchant_id, payment_method_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
  # Request a payment method
56
48
  def request_payment_method(request, merchant_id, headers: {})
57
- endpoint = '/merchants/{merchantId}/paymentMethodSettings'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint, merchant_id)
49
+ endpoint = build_endpoint('/merchants/{merchantId}/paymentMethodSettings', merchant_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
  # Update a payment method
66
56
  def update_payment_method(request, merchant_id, payment_method_id, headers: {})
67
- endpoint = '/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}'.gsub(/{.+?}/, '%s')
68
- endpoint = endpoint.gsub(%r{^/}, '')
69
- endpoint = format(endpoint, merchant_id, payment_method_id)
57
+ endpoint = build_endpoint('/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId}', merchant_id, payment_method_id)
70
58
 
71
59
  action = { method: 'patch', url: endpoint }
72
60
  @client.call_adyen_api(@service, action, request, headers, @version)
@@ -14,9 +14,7 @@ module Adyen
14
14
 
15
15
  # Add a payout setting
16
16
  def add_payout_setting(request, merchant_id, headers: {})
17
- endpoint = '/merchants/{merchantId}/payoutSettings'.gsub(/{.+?}/, '%s')
18
- endpoint = endpoint.gsub(%r{^/}, '')
19
- endpoint = format(endpoint, merchant_id)
17
+ endpoint = build_endpoint('/merchants/{merchantId}/payoutSettings', 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
  # Delete a payout setting
26
24
  def delete_payout_setting(merchant_id, payout_settings_id, headers: {})
27
- endpoint = '/merchants/{merchantId}/payoutSettings/{payoutSettingsId}'.gsub(/{.+?}/, '%s')
28
- endpoint = endpoint.gsub(%r{^/}, '')
29
- endpoint = format(endpoint, merchant_id, payout_settings_id)
25
+ endpoint = build_endpoint('/merchants/{merchantId}/payoutSettings/{payoutSettingsId}', merchant_id, payout_settings_id)
30
26
 
31
27
  action = { method: 'delete', url: endpoint }
32
28
  @client.call_adyen_api(@service, action, {}, headers, @version)
@@ -34,9 +30,7 @@ module Adyen
34
30
 
35
31
  # Get a payout setting
36
32
  def get_payout_setting(merchant_id, payout_settings_id, headers: {})
37
- endpoint = '/merchants/{merchantId}/payoutSettings/{payoutSettingsId}'.gsub(/{.+?}/, '%s')
38
- endpoint = endpoint.gsub(%r{^/}, '')
39
- endpoint = format(endpoint, merchant_id, payout_settings_id)
33
+ endpoint = build_endpoint('/merchants/{merchantId}/payoutSettings/{payoutSettingsId}', merchant_id, payout_settings_id)
40
34
 
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 payout settings
46
40
  def list_payout_settings(merchant_id, headers: {})
47
- endpoint = '/merchants/{merchantId}/payoutSettings'.gsub(/{.+?}/, '%s')
48
- endpoint = endpoint.gsub(%r{^/}, '')
49
- endpoint = format(endpoint, merchant_id)
41
+ endpoint = build_endpoint('/merchants/{merchantId}/payoutSettings', merchant_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
  # Update a payout setting
56
48
  def update_payout_setting(request, merchant_id, payout_settings_id, headers: {})
57
- endpoint = '/merchants/{merchantId}/payoutSettings/{payoutSettingsId}'.gsub(/{.+?}/, '%s')
58
- endpoint = endpoint.gsub(%r{^/}, '')
59
- endpoint = format(endpoint, merchant_id, payout_settings_id)
49
+ endpoint = build_endpoint('/merchants/{merchantId}/payoutSettings/{payoutSettingsId}', merchant_id, payout_settings_id)
60
50
 
61
51
  action = { method: 'patch', url: endpoint }
62
52
  @client.call_adyen_api(@service, action, request, headers, @version)